From b8417bcccbde323159af5dcdf6d5bb29ca70bbf3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 23 May 2018 09:34:21 +0200 Subject: [PATCH] If the label tag exists in the xml material file, but without any string in it, the label.text return None and then it makes Cura crashing when creating the models. This is intended to fix the issue #3750 --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 6dcd5a5ccc..6e9f2af911 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -514,7 +514,7 @@ class XmlMaterialProfile(InstanceContainer): color = entry.find("./um:color", self.__namespaces) label = entry.find("./um:label", self.__namespaces) - if label is not None: + if label is not None and label.text is not None: meta_data["name"] = label.text else: meta_data["name"] = self._profile_name(material.text, color.text) @@ -805,7 +805,9 @@ class XmlMaterialProfile(InstanceContainer): color = entry.find("./um:color", cls.__namespaces) label = entry.find("./um:label", cls.__namespaces) - if label is not None: + if "Rigid" in brand.text: + print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", label, label is not None, label.text if label is not None else ":") + if label is not None and label.text is not None: base_metadata["name"] = label.text else: base_metadata["name"] = cls._profile_name(material.text, color.text)