Some better null object handling #731

This commit is contained in:
Jamie.Rees 2016-12-08 08:45:42 +00:00
commit 2a56bd2648
3 changed files with 18 additions and 20 deletions

View file

@ -147,7 +147,10 @@ namespace PlexRequests.Services.Jobs
var imdbId = PlexHelper.GetProviderIdFromPlexGuid(plexGUID);
var info = _movieApi.GetMovieInformation(imdbId).Result;
if (info == null)
{
throw new Exception($"Movie with Imdb id {imdbId} returned null from the MovieApi");
}
AddImageInsideTable(sb, $"https://image.tmdb.org/t/p/w500{info.BackdropPath}");
sb.Append("<tr>");