From 595dce821b0c59098185e20a6815241624cd74c4 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 6 May 2009 13:05:09 +0900 Subject: [PATCH] fix bug deleting current model in deck properties --- ankiqt/ui/deckproperties.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/deckproperties.py b/ankiqt/ui/deckproperties.py index ca5015602..6f4d634f6 100644 --- a/ankiqt/ui/deckproperties.py +++ b/ankiqt/ui/deckproperties.py @@ -114,8 +114,12 @@ class DeckProperties(QDialog): item = QListWidgetItem(name) self.dialog.modelsList.addItem(item) cm = self.d.currentModel - if ankiqt.mw.currentCard: - cm = ankiqt.mw.currentCard.fact.model + try: + if ankiqt.mw.currentCard: + cm = ankiqt.mw.currentCard.fact.model + except: + # model has been deleted + pass if model == cm: self.dialog.modelsList.setCurrentItem(item)