mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Don't crash on editing metadata entries of non-registered materials
Sometimes we need to create a temporary material profile just to save it to file. Contributes to issue CURA-5787.
This commit is contained in:
parent
dbb8514a6a
commit
d6f116b156
1 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,9 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
material_manager = CuraApplication.getInstance().getMaterialManager()
|
||||
root_material_id = self.getMetaDataEntry("base_file") #if basefile is self.getId, this is a basefile.
|
||||
material_group = material_manager.getMaterialGroup(root_material_id)
|
||||
|
||||
if not material_group: #If the profile is not registered in the registry but loose/temporary, it will not have a base file tree.
|
||||
super().setMetaDataEntry(key, value)
|
||||
return
|
||||
# Update the root material container
|
||||
root_material_container = material_group.root_material_node.getContainer()
|
||||
if root_material_container is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue