mirror of
https://github.com/Jackett/Jackett
synced 2025-02-22 22:31:09 +00:00
Cardigann: fix null pointer exception in if template
This commit is contained in:
parent
4cd01433b7
commit
3ae850e69b
1 changed files with 4 additions and 2 deletions
|
@ -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()));
|
||||
|
|
Loading…
Reference in a new issue