From 0dc08bbacc8f35e81c4281eb022f339e388535ab Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 8 Jan 2017 20:47:26 +1000 Subject: [PATCH] fix error appearing when undo shortcut pressed when nothing to undo --- aqt/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aqt/main.py b/aqt/main.py index 24ea6d27e..474919f73 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -682,6 +682,8 @@ title="%s" %s>%s''' % ( def onUndo(self): n = self.col.undoName() + if not n: + return cid = self.col.undo() if cid and self.state == "review": card = self.col.getCard(cid)