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.
This commit is contained in:
Ghostkeeper 2018-05-08 10:43:55 +02:00
parent a6676fb477
commit 304c23b87e
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -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