mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-19 04:09:40 +08:00
Fix crashing when material could not be found
See CURA-3M in sentry. It most commonly happens with the anycubic, since it had some weird stuff with it suddenly supporting materials. This change will make it so that no crash happens. Old profiles will still have an empty material. This isn't really an issue, since the interface will mark this as an error (prompting users to switch).
This commit is contained in:
parent
b9ff66af00
commit
769fc8fd37
@ -114,7 +114,10 @@ class IntentModel(ListModel):
|
||||
Logger.log("w", "Could not find the variant %s", active_variant_name)
|
||||
continue
|
||||
active_variant_node = machine_node.variants[active_variant_name]
|
||||
active_material_node = active_variant_node.materials[extruder.material.getMetaDataEntry("base_file")]
|
||||
active_material_node = active_variant_node.materials.get(extruder.material.getMetaDataEntry("base_file"))
|
||||
if active_material_node is None:
|
||||
Logger.log("w", "Could not find the material %s", extruder.material.getMetaDataEntry("base_file"))
|
||||
continue
|
||||
nodes.add(active_material_node)
|
||||
|
||||
return nodes
|
||||
|
Loading…
x
Reference in New Issue
Block a user