Safer check for extruder vs. global

Because it might be an empty string.

Contributes to issue CURA-5054.
This commit is contained in:
Ghostkeeper 2018-03-09 16:07:54 +01:00
parent b797ac1a15
commit 3a832d66a9
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -16,7 +16,7 @@ class QualityChangesGroup(QualityGroup):
def addNode(self, node: "QualityNode"):
extruder_position = node.metadata.get("position")
if not extruder_position: #Then we're a global quality changes profile.
if extruder_position is None: #Then we're a global quality changes profile.
if self.node_for_global is not None:
raise RuntimeError("{group} tries to overwrite the existing node_for_global {original_global} with {new_global}".format(group = self, original_global = self.node_for_global, new_global = node))
self.node_for_global = node