Skip to content

Commit d31c071

Browse files
committed
Fix errors when imgur api details aren't specified
1 parent 5d74e48 commit d31c071

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

plugins/imgur.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ def get_items(text):
4949
def load_api(bot):
5050
global imgur_api
5151

52-
client_id = bot.config.get("api_keys", {}).get("imgur_client_id")
53-
client_secret = bot.config.get("api_keys", {}).get("imgur_client_secret")
52+
api_keys = bot.config.get("api_keys", {})
53+
client_id = api_keys.get("imgur_client_id")
54+
client_secret = api_keys.get("imgur_client_secret")
5455

55-
if None in (client_id, client_secret):
56+
if not (client_id and client_secret):
57+
# Either the client id or secret aren't specified
5658
imgur_api = None
5759
return
5860
else:

0 commit comments

Comments
 (0)