mirror of
https://github.com/lutris/lutris
synced 2024-10-06 07:50:16 +00:00
Handle incorrectly formatted API tokens (Closes #1721)
This commit is contained in:
parent
d6419533a2
commit
20f11abda1
|
@ -24,7 +24,11 @@ def read_api_key():
|
|||
return None
|
||||
with open(API_KEY_FILE_PATH, "r") as token_file:
|
||||
api_string = token_file.read()
|
||||
username, token = api_string.split(":")
|
||||
try:
|
||||
username, token = api_string.split(":")
|
||||
except ValueError:
|
||||
logger.error("Unable to read Lutris token in %s", API_KEY_FILE_PATH)
|
||||
return None
|
||||
return {"token": token, "username": username}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue