From f5b57db75371aec6d46536748b8f799cbd6b4064 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 6 Jun 2023 23:00:12 +0300 Subject: [PATCH] Check if release still exists in cache when grabbing release --- src/Prowlarr.Api.V1/Search/SearchController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Prowlarr.Api.V1/Search/SearchController.cs b/src/Prowlarr.Api.V1/Search/SearchController.cs index bf380eacc..8ffd81a71 100644 --- a/src/Prowlarr.Api.V1/Search/SearchController.cs +++ b/src/Prowlarr.Api.V1/Search/SearchController.cs @@ -57,6 +57,13 @@ namespace Prowlarr.Api.V1.Search var releaseInfo = _remoteReleaseCache.Find(GetCacheKey(release)); + if (releaseInfo == null) + { + _logger.Debug("Couldn't find requested release in cache, cache timeout probably expired."); + + throw new NzbDroneClientException(HttpStatusCode.NotFound, "Couldn't find requested release in cache, try searching again"); + } + var indexerDef = _indexerFactory.Get(release.IndexerId); var source = Request.GetSource(); var host = Request.GetHostName();