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
This commit is contained in:
Remco Burema 2024-03-28 17:00:57 +01:00
parent e85e50cce4
commit 93861073d3

View file

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