Fixed: Possible Null Ref in Old API

pull/4873/head
Qstick 4 years ago
parent 69f4f1c168
commit a6d509c871

@ -42,19 +42,12 @@ namespace NzbDrone.Api.Movies
protected MovieResource GetMovie(int id)
{
var movie = _movieService.GetMovie(id);
var resource = MapToResource(movie, true);
return resource;
return MapToResource(movie);
}
protected MovieResource MapToResource(Core.Movies.Movie episode, bool includeSeries)
protected MovieResource MapToResource(Movie movie)
{
var resource = episode.ToResource();
if (includeSeries)
{
var series = episode ?? _movieService.GetMovie(episode.Id);
resource = series.ToResource();
}
var resource = movie.ToResource();
return resource;
}

@ -37,7 +37,7 @@ namespace NzbDrone.Api.Wanted
pagingSpec.FilterExpressions.Add(v => v.Monitored == true);
}
var resource = ApplyToPage(_movieCutoffService.MoviesWhereCutoffUnmet, pagingSpec, v => MapToResource(v, true));
var resource = ApplyToPage(_movieCutoffService.MoviesWhereCutoffUnmet, pagingSpec, v => MapToResource(v));
return resource;
}

@ -32,7 +32,7 @@ namespace NzbDrone.Api.Wanted
pagingSpec.FilterExpressions.Add(v => v.Monitored == true);
}
var resource = ApplyToPage(_movieService.MoviesWithoutFiles, pagingSpec, v => MapToResource(v, true));
var resource = ApplyToPage(_movieService.MoviesWithoutFiles, pagingSpec, v => MapToResource(v));
return resource;
}

Loading…
Cancel
Save