From 3ae850e69bd221fcd134b91740cfe5fe1dd5f1e8 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Wed, 8 Nov 2017 16:18:28 +0100 Subject: [PATCH] Cardigann: fix null pointer exception in if template --- src/Jackett.Common/Indexers/CardigannIndexer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Jackett.Common/Indexers/CardigannIndexer.cs b/src/Jackett.Common/Indexers/CardigannIndexer.cs index 1eeb50103..593f97576 100644 --- a/src/Jackett.Common/Indexers/CardigannIndexer.cs +++ b/src/Jackett.Common/Indexers/CardigannIndexer.cs @@ -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()));