Prevent NullRef for cases when media covers have nullable urls

(cherry picked from commit a26df9e9afa8d925c2ad62c126d4edebec7e4e54)

Closes #2981
This commit is contained in:
Bogdan 2023-10-05 02:42:18 +03:00
parent bb5ad605fd
commit 5b4f54a959

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using NzbDrone.Common.Cache;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
@ -30,6 +31,11 @@ public MediaCoverProxy(IHttpClient httpClient, IConfigFileProvider configFilePro
public string RegisterUrl(string url)
{
if (url.IsNullOrWhiteSpace())
{
return null;
}
var hash = url.SHA256Hash();
_cache.Set(hash, url, TimeSpan.FromHours(24));