diff --git a/aqt/preferences.py b/aqt/preferences.py index 37453d9b1..68e62f741 100644 --- a/aqt/preferences.py +++ b/aqt/preferences.py @@ -29,6 +29,9 @@ class Preferences(QDialog): self.show() def accept(self): + # avoid exception if main window is already closed + if not self.mw.col: + return self.updateCollection() self.updateNetwork() self.updateBackup()