Fixed: Hopefully fixed issue where a null downloadId or title would cause no downloads to be tracked.

Fixes #3260
This commit is contained in:
Leonardo Galli 2018-12-24 14:49:33 +01:00
parent ff894d5210
commit 44842a4e6b
1 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,20 @@ namespace NzbDrone.Core.Download.TrackedDownloads
public TrackedDownload TrackDownload(DownloadClientDefinition downloadClient, DownloadClientItem downloadItem)
{
if (downloadItem.DownloadId.IsNullOrWhiteSpace())
{
_logger.Warn("The following download client item ({0}) has no download hash (id), so it cannot be tracked: {1}",
downloadClient.Name, downloadItem.Title);
return null;
}
if (downloadItem.Title.IsNullOrWhiteSpace())
{
_logger.Warn("The following download client item ({0}) has no title so it cannot be tracked: {1}",
downloadClient.Name, downloadItem.Title);
return null;
}
var existingItem = Find(downloadItem.DownloadId);
if (existingItem != null && existingItem.State != TrackedDownloadStage.Downloading)