mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37: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
|
@ -895,7 +895,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
variant_type = VariantType.BUILD_PLATE
|
||||
|
||||
node = variant_manager.getVariantNode(global_stack.definition.getId(), variant_name, variant_type)
|
||||
if node is not None:
|
||||
if node is not None and node.getContainer() is not None:
|
||||
global_stack.variant = node.getContainer()
|
||||
|
||||
for position, extruder_stack in extruder_stack_dict.items():
|
||||
|
@ -911,7 +911,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
variant_type = VariantType.NOZZLE
|
||||
|
||||
node = variant_manager.getVariantNode(global_stack.definition.getId(), variant_name, variant_type)
|
||||
if node is not None:
|
||||
if node is not None and node.getContainer() is not None:
|
||||
extruder_stack.variant = node.getContainer()
|
||||
|
||||
def _applyMaterials(self, global_stack, extruder_stack_dict):
|
||||
|
@ -937,7 +937,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
extruder_stack.variant.getName(),
|
||||
machine_material_diameter,
|
||||
root_material_id)
|
||||
if material_node is not None:
|
||||
if material_node is not None and material_node.getContainer() is not None:
|
||||
extruder_stack.material = material_node.getContainer()
|
||||
|
||||
def _applyChangesToMachine(self, global_stack, extruder_stack_dict):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue