diff options
Diffstat (limited to 'push.py')
-rwxr-xr-x | push.py | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -116,9 +116,13 @@ msg = payload.strip() # Send notification to each user key for user_token in user_tokens: if type(user_token) is dict: - k = user_token.keys()[0] - device = user_token.get(k, None) - user_token = k + try: + k = user_token.keys()[0] + device = user_token[k] + except (IndexError, KeyError): + next + else: + user_token = k else: device = None |