mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
don't throw error when lastCard() called on deleted card
This commit is contained in:
parent
4998e038bb
commit
999e1ba401
1 changed files with 5 additions and 1 deletions
|
@ -45,7 +45,11 @@ class Reviewer(object):
|
|||
def lastCard(self):
|
||||
if self._answeredIds:
|
||||
if not self.card or self._answeredIds[-1] != self.card.id:
|
||||
return self.mw.col.getCard(self._answeredIds[-1])
|
||||
try:
|
||||
return self.mw.col.getCard(self._answeredIds[-1])
|
||||
except TypeError:
|
||||
# id was deleted
|
||||
return
|
||||
|
||||
def cleanup(self):
|
||||
runHook("reviewCleanup")
|
||||
|
|
Loading…
Reference in a new issue