Browse Source

Fix exception when setting non-existing change outdated

Change-Id: Id6e51e16c36cfda50e990997b7a97590434e2c5f
James E. Blair 2 years ago
parent
commit
fcf512ba85
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      gertty/sync.py

+ 2
- 1
gertty/sync.py View File

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

Loading…
Cancel
Save