From f9aa21aeeafa2f4af004098bc0eed830734ed1a1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 14 Nov 2008 22:42:52 +0900 Subject: [PATCH] work around a strange bug in status --- ankiqt/ui/status.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ankiqt/ui/status.py b/ankiqt/ui/status.py index a0fe71d3a..e9fccb289 100644 --- a/ankiqt/ui/status.py +++ b/ankiqt/ui/status.py @@ -242,15 +242,14 @@ You should aim to answer each question within
if not self.timer: return if self.main.state in ("showQuestion", "showAnswer"): - t = self.main.currentCard.thinkingTime() - if t < 60: - self.timer.setText('00:%02d' % t) - else: - self.timer.setText('01:00') - elif self.main.state == "showAnswer": - pass - else: - self.timer.setText("00:00") + if self.main.currentCard: + t = self.main.currentCard.thinkingTime() + if t < 60: + self.timer.setText('00:%02d' % t) + else: + self.timer.setText('01:00') + return + self.timer.setText("00:00") def onConfigure(self): self.main.deckProperties = ui.deckproperties.DeckProperties(self.main)