diff options
author | Jaime van Kessel <nallath@gmail.com> | 2019-05-16 16:38:44 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2019-05-16 16:38:44 +0300 |
commit | 186eef0b68d1693219721f51789a1579f4599e0d (patch) | |
tree | aaadfbf3158aefb4dd86dd54fbb5239910924b3d /cura/Backups | |
parent | 60488e9ff66097d8104cea05aff5ddd04f5dcd72 (diff) |
Fix backup causing a crash in specific situations
Diffstat (limited to 'cura/Backups')
-rw-r--r-- | cura/Backups/BackupsManager.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cura/Backups/BackupsManager.py b/cura/Backups/BackupsManager.py index 91ee578941..ba6fcab8d7 100644 --- a/cura/Backups/BackupsManager.py +++ b/cura/Backups/BackupsManager.py @@ -51,8 +51,18 @@ class BackupsManager: ## Here we try to disable the auto-save plug-in as it might interfere with # restoring a back-up. def _disableAutoSave(self) -> None: - self._application.getAutoSave().setEnabled(False) + auto_save = self._application.getAutoSave() + # The auto save is only not created if the application has not yet started. + if auto_save: + auto_save.setEnabled(False) + else: + Logger.log("e", "Unable to disable the autosave as application init has not been completed") ## Re-enable auto-save after we're done. def _enableAutoSave(self) -> None: - self._application.getAutoSave().setEnabled(True) + auto_save = self._application.getAutoSave() + # The auto save is only not created if the application has not yet started. + if auto_save: + auto_save.setEnabled(True) + else: + Logger.log("e", "Unable to enable the autosave as application init has not been completed") |