Messages might not have an author

Fixes a KeyError in that case.

Change-Id: If12ba5ab30d926a8614e86617f322dccd5afcda7
This commit is contained in:
James E. Blair 2014-05-05 10:03:08 -07:00
parent 1b9094ab7d
commit 62dd4d9a07

View File

@ -222,7 +222,7 @@ class SyncChangeTask(Task):
created = dateutil.parser.parse(remote_message['date'])
if 'author' in remote_message:
author_name = remote_message['author']['name']
if remote_message['author']['username'] != app.config.username:
if remote_message['author'].get('username') != app.config.username:
new_message = True
else:
author_name = 'Gerrit Code Review'