mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 03:52:33 +02:00
Fixed: Possible Null Ref in Old API
This commit is contained in:
parent
69f4f1c168
commit
a6d509c871
@ -42,19 +42,12 @@ protected MovieModuleWithSignalR(IMovieService movieService,
|
||||
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 @@ private PagingResource<MovieResource> GetCutoffUnmetMovies(PagingResource<MovieR
|
||||
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 @@ private PagingResource<MovieResource> GetMissingMovies(PagingResource<MovieResou
|
||||
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…
Reference in New Issue
Block a user