From 6b2b953686fe9b7d4a73a46331246af9cfd2073e Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 10 Apr 2023 07:49:22 +0300 Subject: [PATCH] Fixed: (Cardigann) Catch errors when `search.rows.count` is not present --- .../Definitions/Cardigann/CardigannParser.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs index 1d3ea704e..967f52b21 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs @@ -81,11 +81,18 @@ namespace NzbDrone.Core.Indexers.Cardigann if (search.Rows.Count != null) { - var countVal = HandleJsonSelector(search.Rows.Count, parsedJson, variables); + try + { + var countVal = HandleJsonSelector(search.Rows.Count, parsedJson, variables); - if (int.TryParse(countVal, out var count) && count < 1) + if (int.TryParse(countVal, out var count) && count < 1) + { + return releases; + } + } + catch (Exception ex) { - return releases; + _logger.Trace(ex, "Failed to parse JSON rows count."); } }