mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Return empty extruder list if no global stack
Just about every call of this function (except 2) would break when this returns None. The signature also says it doesn't return None. Let's return an empty list instead. Contributes to issue CURA-5045.
This commit is contained in:
parent
6d3fed8f52
commit
bd4aba2572
2 changed files with 11 additions and 13 deletions
|
@ -366,7 +366,7 @@ class ExtruderManager(QObject):
|
|||
def getActiveExtruderStacks(self) -> List["ExtruderStack"]:
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack:
|
||||
return None
|
||||
return []
|
||||
|
||||
result = []
|
||||
if global_stack.getId() in self._extruder_trains:
|
||||
|
|
|
@ -509,7 +509,6 @@ class MachineManager(QObject):
|
|||
result = {}
|
||||
|
||||
active_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
||||
if active_stacks is not None: # If we have extruder stacks
|
||||
for stack in active_stacks:
|
||||
material_container = stack.material
|
||||
if not material_container:
|
||||
|
@ -961,7 +960,6 @@ class MachineManager(QObject):
|
|||
result = {}
|
||||
|
||||
active_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
||||
if active_stacks is not None:
|
||||
for stack in active_stacks:
|
||||
variant_container = stack.variant
|
||||
position = stack.getMetaDataEntry("position")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue