mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Defensive against missing global qualities
This is just something I encountered. Could be that some profiles got corrupted. In my case, I had a bug in Uranium that I fixed later. Contributes to issue CURA-6793.
This commit is contained in:
parent
401390209f
commit
9f84304829
1 changed files with 2 additions and 0 deletions
|
|
@ -177,5 +177,7 @@ class MachineNode(ContainerNode):
|
|||
global_qualities = container_registry.findInstanceContainersMetadata(type = "quality", definition = self.quality_definition, global_quality = "True") # First try specific to this printer.
|
||||
if len(global_qualities) == 0: # This printer doesn't override the global qualities.
|
||||
global_qualities = container_registry.findInstanceContainersMetadata(type = "quality", definition = "fdmprinter", global_quality = "True") # Otherwise pick the global global qualities.
|
||||
if len(global_qualities) == 0: # There are no global qualities either?! Something went very wrong, but we'll not crash and properly fill the tree.
|
||||
global_qualities = [cura.CuraApplication.CuraApplication.getInstance().empty_quality_container.getMetaData()]
|
||||
for global_quality in global_qualities:
|
||||
self.global_qualities[global_quality["quality_type"]] = QualityNode(global_quality["id"], parent = self)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue