From c221e2097a778c3c422f59e10c9c887795717393 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 5 Oct 2023 02:42:18 +0300 Subject: [PATCH] Prevent NullRef for cases when media covers have nullable urls --- src/NzbDrone.Core/MediaCover/MediaCoverProxy.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/NzbDrone.Core/MediaCover/MediaCoverProxy.cs b/src/NzbDrone.Core/MediaCover/MediaCoverProxy.cs index b8b0cc3a0..fa489171b 100644 --- a/src/NzbDrone.Core/MediaCover/MediaCoverProxy.cs +++ b/src/NzbDrone.Core/MediaCover/MediaCoverProxy.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; 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 @@ namespace NzbDrone.Core.MediaCover public string RegisterUrl(string url) { + if (url.IsNullOrWhiteSpace()) + { + return null; + } + var hash = url.SHA256Hash(); _cache.Set(hash, url, TimeSpan.FromHours(24));