mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Add dict key check for a crash found in IntentManager
CURA-6976
This commit is contained in:
parent
c31c1dd6fb
commit
eb4eddd49e
1 changed files with 5 additions and 1 deletions
|
@ -35,8 +35,12 @@ class IntentManager(QObject):
|
|||
# \return A list of metadata dictionaries matching the search criteria, or
|
||||
# an empty list if nothing was found.
|
||||
def intentMetadatas(self, definition_id: str, nozzle_name: str, material_base_file: str) -> List[Dict[str, Any]]:
|
||||
material_node = ContainerTree.getInstance().machines[definition_id].variants[nozzle_name].materials[material_base_file]
|
||||
intent_metadatas = []
|
||||
materials = ContainerTree.getInstance().machines[definition_id].variants[nozzle_name].materials
|
||||
if material_base_file not in materials:
|
||||
return intent_metadatas
|
||||
|
||||
material_node = materials[material_base_file]
|
||||
for quality_node in material_node.qualities.values():
|
||||
for intent_node in quality_node.intents.values():
|
||||
intent_metadatas.append(intent_node.getMetadata())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue