fix error appearing when undo shortcut pressed when nothing to undo

This commit is contained in:
Damien Elmes 2017-01-08 20:47:26 +10:00
parent 70e751f6ec
commit 0dc08bbacc

View file

@ -682,6 +682,8 @@ title="%s" %s>%s</button>''' % (
def onUndo(self): def onUndo(self):
n = self.col.undoName() n = self.col.undoName()
if not n:
return
cid = self.col.undo() cid = self.col.undo()
if cid and self.state == "review": if cid and self.state == "review":
card = self.col.getCard(cid) card = self.col.getCard(cid)