[reddit] fix "KeyError: 'children'" when expanding comments (#9037)

This commit is contained in:
Mike Fährmann
2026-02-10 18:23:15 +01:00
parent d491564f8a
commit f67b99a7b4

View File

@@ -484,7 +484,8 @@ class RedditAPI():
data = self._call(endpoint, params)["json"]
for thing in data["data"]["things"]:
if thing["kind"] == "more":
children.extend(thing["data"]["children"])
if more := thing["data"].get("children"):
children.extend(more)
else:
yield thing["data"]