1
0
Fork 0
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:
kaso17 2017-11-08 16:18:28 +01:00
parent 4cd01433b7
commit 3ae850e69b

View file

@ -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()));