From 06f7a8d95feeafa186ec7cb4f4a33290582dc0fd Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 1 Oct 2020 22:08:25 +0200 Subject: [PATCH] Fix parsing "Show more" without digits --- src/parser.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser.nim b/src/parser.nim index 362ecd3..47b83f5 100644 --- a/src/parser.nim +++ b/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: