Sfoglia il codice sorgente

Fix parsing "Show more" without digits

Zed 6 anni fa
parent
commit
06f7a8d95f
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      src/parser.nim

+ 4 - 1
src/parser.nim

@@ -321,8 +321,11 @@ proc parseThread(js: JsonNode; global: GlobalObjects): tuple[thread: Chain, self
       let
         cursor = content{"timelineCursor"}
         more = cursor{"displayTreatment", "actionText"}.getStr
-      result.thread.more = parseInt(more[0 ..< more.find(" ")])
       result.thread.cursor = cursor{"value"}.getStr
+      if more.len > 0 and more[0].isDigit():
+        result.thread.more = parseInt(more[0 ..< more.find(" ")])
+      else:
+        result.thread.more = -1
     else:
       var tweet = finalizeTweet(global, entry.getId)
       if not tweet.available: