diff options
author | Ghostkeeper <rubend@tutanota.com> | 2022-02-24 18:31:32 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2022-02-24 18:31:32 +0300 |
commit | 60c91b56800e8df23c775e233667bca6a68b6cfb (patch) | |
tree | 0c9e761b2d9a43cd64beb0add8349145c87dd903 /plugins/VersionUpgrade/VersionUpgrade48to49 | |
parent | 9fa6698da3fad625c192da4f7094a87ac2615595 (diff) |
Fix crash when visible_settings is missing from pre-4.8 project files
Found this while testing the new Qt interface.
Diffstat (limited to 'plugins/VersionUpgrade/VersionUpgrade48to49')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py index 4595e66ed3..14db98c1fc 100644 --- a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py +++ b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py @@ -29,9 +29,10 @@ class VersionUpgrade48to49(VersionUpgrade): parser["general"]["version"] = "7" # Update visibility settings to include new top_bottom category - parser["general"]["visible_settings"] += ";top_bottom" + if "visible_settings" in parser["general"]: + parser["general"]["visible_settings"] += ";top_bottom" - if "categories_expanded" in parser["cura"] and any([setting in parser["cura"]["categories_expanded"] for setting in self._moved_visibility_settings]): + if "cura" in parser and "categories_expanded" in parser["cura"] and any([setting in parser["cura"]["categories_expanded"] for setting in self._moved_visibility_settings]): parser["cura"]["categories_expanded"] += ";top_bottom" # If the account scope in 4.8 is outdated, delete it so that the user is enforced to log in again and get the |