mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 15:16:03 +08: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
@ -95,10 +95,14 @@ class UFPWriter(MeshWriter):
|
||||
added_materials = []
|
||||
for extruder_stack in global_stack.extruders.values():
|
||||
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
|
||||
|
||||
#Same material cannot be added
|
||||
# The same material should not be added again.
|
||||
if material_file_name in added_materials:
|
||||
continue
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user