From 93861073d3a64a8fd1d244727a618d88f7016f88 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 28 Mar 2024 17:00:57 +0100 Subject: [PATCH] Fix another open-file resulting in a crash. If the materials doesn't have the right key in it, just continue. It should be somewhere after all. part of CURA-11772 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 88c79f2b84..0905b6fba9 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -1240,7 +1240,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader): root_material_id = extruder_info.root_material_id root_material_id = self._old_new_materials.get(root_material_id, root_material_id) - material_node = machine_node.variants[extruder_stack.variant.getName()].materials[root_material_id] + available_materials = machine_node.variants[extruder_stack.variant.getName()].materials + if root_material_id not in available_materials: + continue + material_node = available_materials[root_material_id] extruder_stack.material = material_node.container def _clearMachineSettings(self, global_stack, extruder_stack_dict):