mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Prevent UFP writer from crashing if the base file of a material can not be found
Another issue found in the crash reports
This commit is contained in:
parent
d5e34cc9c9
commit
1a037bdb82
1 changed files with 6 additions and 2 deletions
|
@ -95,10 +95,14 @@ class UFPWriter(MeshWriter):
|
||||||
added_materials = []
|
added_materials = []
|
||||||
for extruder_stack in global_stack.extruders.values():
|
for extruder_stack in global_stack.extruders.values():
|
||||||
material = extruder_stack.material
|
material = extruder_stack.material
|
||||||
material_file_name = material.getMetaData()["base_file"] + ".xml.fdm_material"
|
try:
|
||||||
|
material_file_name = material.getMetaData()["base_file"] + ".xml.fdm_material"
|
||||||
|
except KeyError:
|
||||||
|
Logger.log("w", "Unable to get base_file for the material %s", material.getId())
|
||||||
|
continue
|
||||||
material_file_name = "/Materials/" + material_file_name
|
material_file_name = "/Materials/" + material_file_name
|
||||||
|
|
||||||
#Same material cannot be added
|
# The same material should not be added again.
|
||||||
if material_file_name in added_materials:
|
if material_file_name in added_materials:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue