diff --git a/Shokofin/API/ShokoAPIManager.cs b/Shokofin/API/ShokoAPIManager.cs index c08a15a..848f4e4 100644 --- a/Shokofin/API/ShokoAPIManager.cs +++ b/Shokofin/API/ShokoAPIManager.cs @@ -1008,7 +1008,7 @@ private Task CreateSeasonInfo(TmdbSeason tmdbSeason, TmdbShow tmdbSh string? topLevelShokoGroupId = null; if (tmdbSeason.SeasonNumber > 0) { var animeIds = (await ApiClient.GetTmdbCrossReferencesForTmdbShow(tmdbSeason.ShowId.ToString()).ConfigureAwait(false)) - .Where(x => tmdbEpisodes[x.TmdbEpisodeId].SeasonId == tmdbSeason.Id) + .Where(x => tmdbEpisodes.TryGetValue(x.TmdbEpisodeId, out var tmdbEpisode) && tmdbEpisode.SeasonId == tmdbSeason.Id) .GroupBy(x => x.AnidbAnimeId) .OrderByDescending(x => x.Count()) .Select(x => x.Key)