mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
fix bug deleting current model in deck properties
This commit is contained in:
parent
ec80479de4
commit
595dce821b
1 changed files with 6 additions and 2 deletions
|
|
@ -114,8 +114,12 @@ class DeckProperties(QDialog):
|
||||||
item = QListWidgetItem(name)
|
item = QListWidgetItem(name)
|
||||||
self.dialog.modelsList.addItem(item)
|
self.dialog.modelsList.addItem(item)
|
||||||
cm = self.d.currentModel
|
cm = self.d.currentModel
|
||||||
if ankiqt.mw.currentCard:
|
try:
|
||||||
cm = ankiqt.mw.currentCard.fact.model
|
if ankiqt.mw.currentCard:
|
||||||
|
cm = ankiqt.mw.currentCard.fact.model
|
||||||
|
except:
|
||||||
|
# model has been deleted
|
||||||
|
pass
|
||||||
if model == cm:
|
if model == cm:
|
||||||
self.dialog.modelsList.setCurrentItem(item)
|
self.dialog.modelsList.setCurrentItem(item)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue