mirror of
https://github.com/zedeus/nitter
synced 2024-11-26 11:40:00 +01:00
Prevent crash when token missing
This commit is contained in:
parent
87d1e49f1a
commit
baa28ea8bc
@ -18,7 +18,10 @@ proc fetchToken(): Future[Token] {.async.} =
|
||||
try: client.close()
|
||||
except: discard
|
||||
|
||||
if pos == -1: echo "token parse fail"; return
|
||||
if pos == -1:
|
||||
echo "token parse fail"
|
||||
return Token()
|
||||
|
||||
result = Token(tok: resp[pos+3 .. pos+21], remaining: 187,
|
||||
reset: getTime() + 15.minutes, init: getTime())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user