1
0
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:
Zed 2020-06-01 13:54:14 +02:00
parent 87d1e49f1a
commit baa28ea8bc

View File

@ -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())