fix null exception possibility in cp/sickrage cacher classes

pull/284/head
Drewster727 9 years ago
parent 25714f03f7
commit a679f1a6a1

@ -87,7 +87,7 @@ namespace PlexRequests.Services.Jobs
public int[] QueuedIds()
{
var movies = Cache.Get<CouchPotatoMovies>(CacheKeys.CouchPotatoQueued);
return movies?.movies.Select(x => x.info.tmdb_id).ToArray() ?? new int[] { };
return movies?.movies?.Select(x => x.info.tmdb_id).ToArray() ?? new int[] { };
}
public void Execute(IJobExecutionContext context)

@ -87,7 +87,7 @@ namespace PlexRequests.Services.Jobs
public int[] QueuedIds()
{
var tv = Cache.Get<SickrageShows>(CacheKeys.SickRageQueued);
return tv?.data.Values.Select(x => x.tvdbid).ToArray() ?? new int[] { };
return tv?.data?.Values.Select(x => x.tvdbid).ToArray() ?? new int[] { };
}
public void Execute(IJobExecutionContext context)

Loading…
Cancel
Save