mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:09:02 +08:00
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
This commit is contained in:
parent
403129e2d6
commit
b8417bcccb
@ -514,7 +514,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||||||
color = entry.find("./um:color", self.__namespaces)
|
color = entry.find("./um:color", self.__namespaces)
|
||||||
label = entry.find("./um:label", 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
|
meta_data["name"] = label.text
|
||||||
else:
|
else:
|
||||||
meta_data["name"] = self._profile_name(material.text, color.text)
|
meta_data["name"] = self._profile_name(material.text, color.text)
|
||||||
@ -805,7 +805,9 @@ class XmlMaterialProfile(InstanceContainer):
|
|||||||
color = entry.find("./um:color", cls.__namespaces)
|
color = entry.find("./um:color", cls.__namespaces)
|
||||||
label = entry.find("./um:label", 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
|
base_metadata["name"] = label.text
|
||||||
else:
|
else:
|
||||||
base_metadata["name"] = cls._profile_name(material.text, color.text)
|
base_metadata["name"] = cls._profile_name(material.text, color.text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user