Browse Source

Initialise config_name

Just a mistake that I saw because my IDE warned me about this. If a variant in Cura 2.3 has no general/name keyword, then it would break here. Now it doesn't break any more and gives a nonsensical name.

Contributes to issue CURA-3427.
Ghostkeeper 7 years ago
parent
commit
6e01c6ba60
1 changed files with 1 additions and 0 deletions
  1. 1 0
      plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py

+ 1 - 0
plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py

@@ -77,6 +77,7 @@ class VersionUpgrade22to24(VersionUpgrade):
         with open(variant_path, "r") as fhandle:
             variant_config.read_file(fhandle)
 
+        config_name = "Unknown Variant"
         if variant_config.has_section("general") and variant_config.has_option("general", "name"):
             config_name = variant_config.get("general", "name")
             if config_name.endswith("_variant"):