Prevent crash when token missing
This commit is contained in:
parent
87d1e49f1a
commit
baa28ea8bc
1 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,10 @@ proc fetchToken(): Future[Token] {.async.} =
|
||||||
try: client.close()
|
try: client.close()
|
||||||
except: discard
|
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,
|
result = Token(tok: resp[pos+3 .. pos+21], remaining: 187,
|
||||||
reset: getTime() + 15.minutes, init: getTime())
|
reset: getTime() + 15.minutes, init: getTime())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue