mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Allow getContainer() to return None
And in the rest of the locations we must then check if it's None and handle that gracefully. Here we assume that the getContainer message shows a message to the user if necessary. For now we'll just log it. Contributes to issue CURA-5045.
This commit is contained in:
parent
2a39d81a3c
commit
6d3fed8f52
9 changed files with 52 additions and 23 deletions
|
@ -71,12 +71,14 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
|
||||
# Update the root material container
|
||||
root_material_container = material_group.root_material_node.getContainer()
|
||||
root_material_container.setMetaDataEntry(key, value, apply_to_all = False)
|
||||
if root_material_container is not None:
|
||||
root_material_container.setMetaDataEntry(key, value, apply_to_all = False)
|
||||
|
||||
# Update all containers derived from it
|
||||
for node in material_group.derived_material_node_list:
|
||||
container = node.getContainer()
|
||||
container.setMetaDataEntry(key, value, apply_to_all = False)
|
||||
if container is not None:
|
||||
container.setMetaDataEntry(key, value, apply_to_all = False)
|
||||
|
||||
## Overridden from InstanceContainer, similar to setMetaDataEntry.
|
||||
# without this function the setName would only set the name of the specific nozzle / material / machine combination container
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue