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:
authorGhostkeeper <rubend@tutanota.com>2018-05-08 11:43:55 +0300
committerGhostkeeper <rubend@tutanota.com>2018-05-08 11:44:19 +0300
commit304c23b87e79bd1627b6c62f301ad811bb997517 (patch)
tree4ec1c07b609c16743057ed443d8793ca0ccc1b3e /plugins/GCodeWriter
parenta6676fb477747f696e4e9854c7a2e06866a8aed8 (diff)
Fix check for existence of gcode_dict variable
getattr raises an error if it doesn't exist. It doesn't make the variable None or anything.
Diffstat (limited to 'plugins/GCodeWriter')
-rw-r--r--plugins/GCodeWriter/GCodeWriter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py
index f25e249db1..c01d48be4c 100644
--- a/plugins/GCodeWriter/GCodeWriter.py
+++ b/plugins/GCodeWriter/GCodeWriter.py
@@ -66,9 +66,9 @@ class GCodeWriter(MeshWriter):
active_build_plate = Application.getInstance().getMultiBuildPlateModel().activeBuildPlate
scene = Application.getInstance().getController().getScene()
- gcode_dict = getattr(scene, "gcode_dict")
- if not gcode_dict:
+ if not hasattr(scene, "gcode_dict"):
return False
+ gcode_dict = getattr(scene, "gcode_dict")
gcode_list = gcode_dict.get(active_build_plate, None)
if gcode_list is not None:
has_settings = False