mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Cardigann: fix null pointer exception in if template
This commit is contained in:
@@ -266,9 +266,11 @@ namespace Jackett.Indexers
|
||||
var conditionResultState = false;
|
||||
var value = variables[condition];
|
||||
|
||||
if (value is string)
|
||||
if (value == null)
|
||||
conditionResultState = false;
|
||||
else if (value is string)
|
||||
conditionResultState = !string.IsNullOrWhiteSpace((string)value);
|
||||
else if(value is ICollection)
|
||||
else if (value is ICollection)
|
||||
conditionResultState = ((ICollection)value).Count > 0;
|
||||
else
|
||||
throw new Exception(string.Format("Unexpceted type for variable {0}: {1}", condition, value.GetType()));
|
||||
|
Reference in New Issue
Block a user