1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-01-20 13:49:56 +00:00

Prevent NullRef for cases when media covers have nullable urls

(cherry picked from commit a26df9e9afa8d925c2ad62c126d4edebec7e4e54)
This commit is contained in:
Bogdan 2023-10-05 02:42:18 +03:00
parent 99dade3200
commit 0a5f0cab60

View file

@ -3,6 +3,7 @@
using System.IO;
using System.Threading.Tasks;
using NzbDrone.Common.Cache;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
@ -31,6 +32,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));