Fix crash on missing quote tweet data crash

This commit is contained in:
Zed 2023-09-14 23:35:41 +00:00 committed by GitHub
parent fcd74e8048
commit 14f9a092d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -324,6 +324,9 @@ proc parseGraphTweet(js: JsonNode; isLegacy=false): Tweet =
of "TweetWithVisibilityResults":
return parseGraphTweet(js{"tweet"}, isLegacy)
if not js.hasKey("legacy"):
return Tweet()
var jsCard = copy(js{if isLegacy: "card" else: "tweet_card", "legacy"})
if jsCard.kind != JNull:
var values = newJObject()