aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/MediaInfoHelper.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-08-31 08:00:05 -0600
committercrobibero <cody@robibe.ro>2020-08-31 08:00:05 -0600
commitbd66fd25df772f3fd352fdda58e71474e255400a (patch)
treea6102da6a9f120d7c887f460c5d603be92ea199f /Jellyfin.Api/Helpers/MediaInfoHelper.cs
parent9626101c9f8d0acceb2ecf97bed502c272d6e4f6 (diff)
parent0424d09b8daf3626fd7de65b601e707afdb00599 (diff)
Merge remote-tracking branch 'upstream/master' into 3.1.7
Diffstat (limited to 'Jellyfin.Api/Helpers/MediaInfoHelper.cs')
-rw-r--r--Jellyfin.Api/Helpers/MediaInfoHelper.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Jellyfin.Api/Helpers/MediaInfoHelper.cs b/Jellyfin.Api/Helpers/MediaInfoHelper.cs
index d2d1855a4..3a736d1e8 100644
--- a/Jellyfin.Api/Helpers/MediaInfoHelper.cs
+++ b/Jellyfin.Api/Helpers/MediaInfoHelper.cs
@@ -127,7 +127,11 @@ namespace Jellyfin.Api.Helpers
{
// Since we're going to be setting properties on MediaSourceInfos that come out of _mediaSourceManager, we should clone it
// Should we move this directly into MediaSourceManager?
- result.MediaSources = JsonSerializer.Deserialize<MediaSourceInfo[]>(JsonSerializer.SerializeToUtf8Bytes(mediaSources));
+ var mediaSourcesClone = JsonSerializer.Deserialize<MediaSourceInfo[]>(JsonSerializer.SerializeToUtf8Bytes(mediaSources));
+ if (mediaSourcesClone != null)
+ {
+ result.MediaSources = mediaSourcesClone;
+ }
result.PlaySessionId = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
}