mirror of
https://github.com/Readarr/Readarr
synced 2025-12-06 08:24:52 +01:00
Prevent NullRef for cases when media covers have nullable urls
(cherry picked from commit a26df9e9afa8d925c2ad62c126d4edebec7e4e54) Closes #2981
This commit is contained in:
parent
bb5ad605fd
commit
5b4f54a959
1 changed files with 6 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue