Avoid exception on exit
Closing anki when the preferences dialog is open will cause an exception since self.mw.col in Preferences is not available anymore. Avoid the exception by checking self.mw.col again on accept().
This commit is contained in:
parent
9c2dcf1ee7
commit
a65c20b3ad
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user