1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00:00

Fix error when season stats are missing

This commit is contained in:
Mark McDowall 2015-06-07 02:14:40 -07:00
parent 5a2fa41af7
commit 4c3c705517

View file

@ -167,9 +167,12 @@ namespace NzbDrone.Api.Series
resource.PreviousAiring = seriesStatistics.PreviousAiring;
resource.SizeOnDisk = seriesStatistics.SizeOnDisk;
foreach (var season in resource.Seasons)
if (seriesStatistics.SeasonStatistics != null)
{
season.Statistics = seriesStatistics.SeasonStatistics.SingleOrDefault(s => s.SeasonNumber == season.SeasonNumber).InjectTo<SeasonStatisticsResource>();
foreach (var season in resource.Seasons)
{
season.Statistics = seriesStatistics.SeasonStatistics.SingleOrDefault(s => s.SeasonNumber == season.SeasonNumber).InjectTo<SeasonStatisticsResource>();
}
}
}