Fixed: (Cardigann) Catch errors when `search.rows.count` is not present

pull/1597/head
Bogdan 2 years ago
parent 31c05be9de
commit 6b2b953686

@ -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.");
}
}

Loading…
Cancel
Save