Fix exception when setting non-existing change outdated

Change-Id: Id6e51e16c36cfda50e990997b7a97590434e2c5f
This commit is contained in:
James E. Blair 2016-11-28 11:14:28 -08:00
parent c20ec64ad8
commit fcf512ba85
1 changed files with 2 additions and 1 deletions

View File

@ -575,7 +575,8 @@ class SyncChangeTask(Task):
self.log.error("Marking change %s outdated" % (self.change_id,))
with sync.app.db.getSession() as session:
change = session.getChangeByID(self.change_id)
change.outdated = True
if change:
change.outdated = True
except Exception:
self.log.exception("Error while marking change %s as outdated" % (self.change_id,))
raise