mirror of https://github.com/Jackett/Jackett
Fixing a null exception when searching AnimeTosho
AnimeTosho failed to populate the Origin field of the results when searching thereby creating an issue upon creating the proxy link. This was mainly because an IEnumerable can contain a deferred LINQ query as well (e.g. in the case of AnimeTosho a Select) that will re-execute every single time. So when iterating over IEnumerables we cannot really pose any assumption on what we are dealing with, so either explicitly force an execution (e.g. via ToList), or use LINQ queries as well. Since the second is probably more performant, let's stick with that.
This commit is contained in:
parent
6fbc4b6904
commit
057df28d1b
|
@ -218,10 +218,11 @@ namespace Jackett.Indexers
|
|||
{
|
||||
var results = await PerformQuery(query);
|
||||
results = FilterResults(query, results);
|
||||
foreach (var result in results)
|
||||
results = results.Select(r =>
|
||||
{
|
||||
result.Origin = this;
|
||||
}
|
||||
r.Origin = this;
|
||||
return r;
|
||||
});
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue