cardigann: catch errors when `search.rows.count` is not found in page

This commit is contained in:
Bogdan 2023-04-10 07:44:40 +03:00
parent d69a846299
commit 9506193e1e
1 changed files with 11 additions and 4 deletions

View File

@ -1451,11 +1451,18 @@ namespace Jackett.Common.Indexers
if (Search.Rows.Count != null) if (Search.Rows.Count != null)
{ {
var countVal = handleJsonSelector(Search.Rows.Count, parsedJson, variables); try
if (int.TryParse(countVal, out var count) && count < 1)
{ {
continue; var countVal = handleJsonSelector(Search.Rows.Count, parsedJson, variables);
if (int.TryParse(countVal, out var count) && count < 1)
{
continue;
}
}
catch (Exception ex)
{
logger.Trace(ex, "Failed to parse JSON rows count.");
} }
} }