From 304c23b87e79bd1627b6c62f301ad811bb997517 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 8 May 2018 10:43:55 +0200 Subject: [PATCH] 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. --- plugins/GCodeWriter/GCodeWriter.py | 4 ++-- 1 file 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