Przeglądaj źródła

Fix crash on missing quote tweet data crash

Zed 3 lat temu
rodzic
commit
14f9a092d8
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      src/parser.nim

+ 3 - 0
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()