From fcf512ba8514b86d5db1814791118ce6559f462a Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 28 Nov 2016 11:14:28 -0800 Subject: [PATCH] Fix exception when setting non-existing change outdated Change-Id: Id6e51e16c36cfda50e990997b7a97590434e2c5f --- gertty/sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gertty/sync.py b/gertty/sync.py index b11522a..ec23659 100644 --- a/gertty/sync.py +++ b/gertty/sync.py @@ -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