Fixed: (Cardigann) Add check for `request.inputs`, since are null when `pathselector` is used

Fixes #1158
pull/1600/head
Bogdan 1 year ago
parent c6ed5d65e0
commit 451f60319f

@ -728,16 +728,19 @@ namespace NzbDrone.Core.Indexers.Cardigann
pairs = new Dictionary<string, string>();
}
foreach (var input in request.Inputs)
if (request.Inputs != null)
{
var value = ApplyGoTemplateText(input.Value, variables);
if (method == HttpMethod.Get)
foreach (var input in request.Inputs)
{
queryCollection.Add(input.Key, value);
}
else if (method == HttpMethod.Post)
{
pairs.Add(input.Key, value);
var value = ApplyGoTemplateText(input.Value, variables);
if (method == HttpMethod.Get)
{
queryCollection.Add(input.Key, value);
}
else if (method == HttpMethod.Post)
{
pairs.Add(input.Key, value);
}
}
}

Loading…
Cancel
Save