aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-11-10 19:31:22 +0000
committerJPVenson <github@jpb.email>2024-11-10 19:31:22 +0000
commit4b0a5ea8e920ba6f31b3d9fcc890c4b49c2647c8 (patch)
treeaa74d0a9ac34f30fddf653cbbc6167132b4b432a /Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
parent4959232b271ca83b6a38571f7cbb7a1ce112ab2f (diff)
Fixed reference aggregate collections nullable when empty
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/BaseItemRepository.cs')
-rw-r--r--Jellyfin.Server.Implementations/Item/BaseItemRepository.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
index a6cdfe61f..a7e803f1c 100644
--- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
@@ -1368,7 +1368,7 @@ public sealed class BaseItemRepository(
dto.TotalBitrate = entity.TotalBitrate;
dto.ExternalId = entity.ExternalId;
dto.Size = entity.Size;
- dto.Genres = entity.Genres?.Split('|');
+ dto.Genres = entity.Genres?.Split('|') ?? [];
dto.DateCreated = entity.DateCreated.GetValueOrDefault();
dto.DateModified = entity.DateModified.GetValueOrDefault();
dto.ChannelId = string.IsNullOrWhiteSpace(entity.ChannelId) ? Guid.Empty : Guid.Parse(entity.ChannelId);
@@ -1398,9 +1398,9 @@ public sealed class BaseItemRepository(
}
dto.ExtraIds = string.IsNullOrWhiteSpace(entity.ExtraIds) ? null : entity.ExtraIds.Split('|').Select(e => Guid.Parse(e)).ToArray();
- dto.ProductionLocations = entity.ProductionLocations?.Split('|');
- dto.Studios = entity.Studios?.Split('|');
- dto.Tags = entity.Tags?.Split('|');
+ dto.ProductionLocations = entity.ProductionLocations?.Split('|') ?? [];
+ dto.Studios = entity.Studios?.Split('|') ?? [];
+ dto.Tags = entity.Tags?.Split('|') ?? [];
if (dto is IHasProgramAttributes hasProgramAttributes)
{
@@ -1440,12 +1440,12 @@ public sealed class BaseItemRepository(
if (dto is IHasArtist hasArtists)
{
- hasArtists.Artists = entity.Artists?.Split('|', StringSplitOptions.RemoveEmptyEntries);
+ hasArtists.Artists = entity.Artists?.Split('|', StringSplitOptions.RemoveEmptyEntries) ?? [];
}
if (dto is IHasAlbumArtist hasAlbumArtists)
{
- hasAlbumArtists.AlbumArtists = entity.AlbumArtists?.Split('|', StringSplitOptions.RemoveEmptyEntries);
+ hasAlbumArtists.AlbumArtists = entity.AlbumArtists?.Split('|', StringSplitOptions.RemoveEmptyEntries) ?? [];
}
if (dto is LiveTvProgram program)