1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 09:37:12 +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,11 +167,14 @@ private void LinkSeriesStatistics(SeriesResource resource, SeriesStatistics seri
resource.PreviousAiring = seriesStatistics.PreviousAiring; resource.PreviousAiring = seriesStatistics.PreviousAiring;
resource.SizeOnDisk = seriesStatistics.SizeOnDisk; resource.SizeOnDisk = seriesStatistics.SizeOnDisk;
if (seriesStatistics.SeasonStatistics != null)
{
foreach (var season in resource.Seasons) foreach (var season in resource.Seasons)
{ {
season.Statistics = seriesStatistics.SeasonStatistics.SingleOrDefault(s => s.SeasonNumber == season.SeasonNumber).InjectTo<SeasonStatisticsResource>(); season.Statistics = seriesStatistics.SeasonStatistics.SingleOrDefault(s => s.SeasonNumber == season.SeasonNumber).InjectTo<SeasonStatisticsResource>();
} }
} }
}
private void PopulateAlternateTitles(List<SeriesResource> resources) private void PopulateAlternateTitles(List<SeriesResource> resources)
{ {