From d14d8145d5d8f233ad91be1ee3a97717dc10094b Mon Sep 17 00:00:00 2001 From: Greenback Date: Mon, 7 Dec 2020 18:27:22 +0000 Subject: [PATCH] Fixed createPlayList --- Emby.Dlna/PlayTo/PlayToController.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs index b7cd91a5c..a7cb7125b 100644 --- a/Emby.Dlna/PlayTo/PlayToController.cs +++ b/Emby.Dlna/PlayTo/PlayToController.cs @@ -340,10 +340,19 @@ namespace Emby.Dlna.PlayTo } var playlist = new PlaylistItem[len]; - playlist[0] = CreatePlaylistItem(items[0], user, command.StartPositionTicks.Value, command.MediaSourceId, command.AudioStreamIndex, command.SubtitleStreamIndex); + + // Not nullable enabled - so this is required. + playlist[0] = CreatePlaylistItem( + items[0], + user, + (command.StartPositionTicks == null) ? 0 : command.StartPositionTicks.Value, + command.MediaSourceId ?? string.Empty, + command.AudioStreamIndex, + command.SubtitleStreamIndex); + for (int i = 1; i < len; i++) { - playlist[i] = CreatePlaylistItem(items[i], user, 0, null, null, null); + playlist[i] = CreatePlaylistItem(items[i], user, 0, string.Empty, null, null); } _logger.LogDebug("{0} - Playlist created", _session.DeviceName);