[reddit] fix "KeyError: 'children'" when expanding comments (#9037)
This commit is contained in:
@@ -484,7 +484,8 @@ class RedditAPI():
|
|||||||
data = self._call(endpoint, params)["json"]
|
data = self._call(endpoint, params)["json"]
|
||||||
for thing in data["data"]["things"]:
|
for thing in data["data"]["things"]:
|
||||||
if thing["kind"] == "more":
|
if thing["kind"] == "more":
|
||||||
children.extend(thing["data"]["children"])
|
if more := thing["data"].get("children"):
|
||||||
|
children.extend(more)
|
||||||
else:
|
else:
|
||||||
yield thing["data"]
|
yield thing["data"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user