Fix call when download history can be null
This commit is contained in:
parent
0e6f858e65
commit
eeb1cb8861
|
@ -70,8 +70,8 @@ namespace NzbDrone.Core.Download
|
|||
return;
|
||||
}
|
||||
|
||||
var grabbedHistories = _historyService.FindByDownloadId(trackedDownload.DownloadItem.DownloadId).Where(h => h.EventType == EpisodeHistoryEventType.Grabbed).ToList();
|
||||
var historyItem = grabbedHistories.MaxBy(h => h.Date);
|
||||
var grabbedHistories = _historyService.FindByDownloadId(trackedDownload.DownloadItem.DownloadId)?.Where(h => h.EventType == EpisodeHistoryEventType.Grabbed).ToList();
|
||||
var historyItem = grabbedHistories?.MaxBy(h => h.Date);
|
||||
|
||||
if (historyItem == null && trackedDownload.DownloadItem.Category.IsNullOrWhiteSpace())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue