Remove unnecessary null checks

This commit is contained in:
mitteneer 2025-06-27 00:31:47 -04:00
parent 0b7efc3420
commit 29041044e7

View file

@ -40,10 +40,10 @@ pub fn entityQueryResult(request: *jetzig.Request, query: GeneratedQuery, args:
.album = if (entity.album_id) |_| .{ .id = entity.album_id.?, .name = entity.album_name.? } else null, .album = if (entity.album_id) |_| .{ .id = entity.album_id.?, .name = entity.album_name.? } else null,
.song = if (entity.song_id) |_| .{ .id = entity.song_id.?, .name = entity.song_name.? } else null, .song = if (entity.song_id) |_| .{ .id = entity.song_id.?, .name = entity.song_name.? } else null,
.artistlist = if (artist_list.getLastOrNull()) |_| try artist_list.toOwnedSlice() else null, .artistlist = if (artist_list.getLastOrNull()) |_| try artist_list.toOwnedSlice() else null,
.scrobbles = if (entity.scrobbles) |scrobbles| scrobbles else null, .scrobbles = entity.scrobbles,
.date = if (entity.date) |date| date else null, .date = entity.date,
.score = if (entity.score) |score| score else null, .score = entity.score,
.review = if (entity.review) |review| review else null, .review = entity.review,
}); });
} }