From 14f9a092d832c0aaf7eb4900ab36a76c6653c364 Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 14 Sep 2023 23:35:41 +0000 Subject: [PATCH] Fix crash on missing quote tweet data crash --- src/parser.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/parser.nim b/src/parser.nim index 914c038..776f176 100644 --- a/src/parser.nim +++ b/src/parser.nim @@ -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()