From 8a515822102d68e2ce0f1e4f52d87b509c7029ef Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 15 Aug 2019 16:17:19 +0200 Subject: [PATCH] Pre-fill list of qualities_per_type_per_extruder with empty dicts Otherwise you get an IndexError later on. Contributes to issue CURA-6600. --- cura/Machines/MachineNode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Machines/MachineNode.py b/cura/Machines/MachineNode.py index d5a9739e53..990aeae935 100644 --- a/cura/Machines/MachineNode.py +++ b/cura/Machines/MachineNode.py @@ -57,7 +57,7 @@ class MachineNode(ContainerNode): Logger.log("e", "The number of extruders in the list of variants (" + str(len(variant_names)) + ") is not equal to the number of extruders in the list of materials (" + str(len(material_bases)) + ") or the list of enabled extruders (" + str(len(extruder_enabled)) + ").") return {} # For each extruder, find which quality profiles are available. Later we'll intersect the quality types. - qualities_per_type_per_extruder = [] # type: List[Dict[str, QualityNode]] + qualities_per_type_per_extruder = [{} for _ in range(len(variant_names))] # type: List[Dict[str, QualityNode]] for extruder_nr, variant_name in enumerate(variant_names): if not extruder_enabled[extruder_nr]: continue # No qualities are available in this extruder. It'll get skipped when calculating the available quality types.