diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Kometa/KometaMetadata.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Kometa/KometaMetadata.cs index 7085b3ddf..d994cef35 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Kometa/KometaMetadata.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Kometa/KometaMetadata.cs @@ -131,7 +131,15 @@ public override List EpisodeImages(Series series, EpisodeFile e try { - var screenshot = episodeFile.Episodes.Value.First().Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot); + var firstEpisode = episodeFile.Episodes.Value.FirstOrDefault(); + + if (firstEpisode == null) + { + _logger.Debug("Episode file has no associated episodes, potentially a duplicate file"); + return new List(); + } + + var screenshot = firstEpisode.Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot); if (screenshot == null) { diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs index 5450a16f3..e66cc89b5 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs @@ -421,7 +421,15 @@ public override List EpisodeImages(Series series, EpisodeFile e try { - var screenshot = episodeFile.Episodes.Value.First().Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot); + var firstEpisode = episodeFile.Episodes.Value.FirstOrDefault(); + + if (firstEpisode == null) + { + _logger.Debug("Episode file has no associated episodes, potentially a duplicate file"); + return new List(); + } + + var screenshot = firstEpisode.Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot); if (screenshot == null) {