Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostas Karmas <konskarm@gmail.com>2021-04-06 17:37:06 +0300
committerKostas Karmas <konskarm@gmail.com>2021-04-06 17:37:06 +0300
commit39e9dcd4f5523ce4df743dfbce4a468e7685d0fa (patch)
tree510cfa3ecc1881db86943f4d3308cd5d0c04b8d1 /plugins/VersionUpgrade/VersionUpgrade48to49
parentb3ea26c9556989d5f68d6a453bc199d76726907f (diff)
Fix VersionUpgrade48to49 crashing if there is no "categories_expanded"
If the 4.8 is started from a clean install and no category gets expanded in the settings panel, then the "categories_expanded" key will not exist in the [cura] preferences in cura.cfg. As a result, when the 4.9 gets started in this specific case, the version upgrade 48 to 49 will produce a crash and will be considered as "failed", which will then lead to cura requesting from the user to go from the entire onboarding flow instead of landing on the "What's new" pages (even though everything else has been properly updated). This commit fixes that by checking whether the "categories_expanded" key exists in the cura.cfg.
Diffstat (limited to 'plugins/VersionUpgrade/VersionUpgrade48to49')
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py
index 789830ef08..bf21a6867d 100644
--- a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py
+++ b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py
@@ -29,7 +29,7 @@ class VersionUpgrade48to49(VersionUpgrade):
# Update visibility settings to include new top_bottom category
parser["general"]["visible_settings"] += ";top_bottom"
- if any([setting in parser["cura"]["categories_expanded"] for setting in self._moved_visibility_settings]):
+ if "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"
result = io.StringIO()