1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-01-04 22:41:49 +00:00

gazellegamesapi: fix NullRef when "Torrents" is not present in the response

This commit is contained in:
Bogdan 2024-12-29 22:57:53 +02:00
parent 668091af05
commit 85b6ee8b69

View file

@ -285,7 +285,7 @@ namespace Jackett.Common.Indexers.Definitions
var groupId = int.Parse(gObj.Key);
var group = gObj.Value as JObject;
if (group["Torrents"].Type == JTokenType.Array && group["Torrents"] is JArray { Count: 0 })
if (group["Torrents"] is not JObject groupTorrents)
{
continue;
}
@ -295,7 +295,9 @@ namespace Jackett.Common.Indexers.Definitions
.Distinct()
.ToArray();
foreach (var tObj in JObject.FromObject(group["Torrents"]))
var torrents = JObject.FromObject(groupTorrents);
foreach (var tObj in torrents)
{
var torrent = tObj.Value as JObject;