mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01: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)
|
protected MovieResource GetMovie(int id)
|
||||||
{
|
{
|
||||||
var movie = _movieService.GetMovie(id);
|
var movie = _movieService.GetMovie(id);
|
||||||
var resource = MapToResource(movie, true);
|
return MapToResource(movie);
|
||||||
return resource;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MovieResource MapToResource(Core.Movies.Movie episode, bool includeSeries)
|
protected MovieResource MapToResource(Movie movie)
|
||||||
{
|
{
|
||||||
var resource = episode.ToResource();
|
var resource = movie.ToResource();
|
||||||
|
|
||||||
if (includeSeries)
|
|
||||||
{
|
|
||||||
var series = episode ?? _movieService.GetMovie(episode.Id);
|
|
||||||
resource = series.ToResource();
|
|
||||||
}
|
|
||||||
|
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ private PagingResource<MovieResource> GetCutoffUnmetMovies(PagingResource<MovieR
|
|||||||
pagingSpec.FilterExpressions.Add(v => v.Monitored == true);
|
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;
|
return resource;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ private PagingResource<MovieResource> GetMissingMovies(PagingResource<MovieResou
|
|||||||
pagingSpec.FilterExpressions.Add(v => v.Monitored == true);
|
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;
|
return resource;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user