mirror of
https://github.com/Jackett/Jackett.git
synced 2025-12-25 23:24:52 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user