Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2019-01-31 16:48:40 +0300
committerJaime van Kessel <nallath@gmail.com>2019-01-31 16:48:40 +0300
commit1a037bdb829605609f3b47082aff7311bde95e12 (patch)
treee4d594e78b568f8b99f20cb0a46a61e7d53d73d3 /plugins/UFPWriter
parentd5e34cc9c99b293c72248989beb088c019802319 (diff)
Prevent UFP writer from crashing if the base file of a material can not be found
Another issue found in the crash reports
Diffstat (limited to 'plugins/UFPWriter')
-rw-r--r--plugins/UFPWriter/UFPWriter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/UFPWriter/UFPWriter.py b/plugins/UFPWriter/UFPWriter.py
index b3088fc863..c0db104c82 100644
--- a/plugins/UFPWriter/UFPWriter.py
+++ b/plugins/UFPWriter/UFPWriter.py
@@ -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