Skip to content

Commit

Permalink
Check for user field before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
magnedavidsen committed Aug 12, 2018
1 parent 78438b4 commit 09a7296
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def is_dm(message):
'https://api.cloudinary.com/v1_1/blank/image/upload', data=payload)
api.save_image(
r2.json()['public_id'], file['user'], file['title'])
elif(is_dm(message)):
elif(is_dm(message) and 'user' in message):
if message['user'] in api.get_invited_users():
if message['text'].lower() == 'ja':
api.rsvp(message['user'], 'attending')
Expand Down

0 comments on commit 09a7296

Please sign in to comment.