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:
Christian Krause 2015-04-26 12:28:32 +02:00
parent 9c2dcf1ee7
commit a65c20b3ad

View File

@ -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()