mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
Make the deletion of the definitionChanges safer
Just in case findContainerStacks returns an empty list
This commit is contained in:
parent
61def4ba25
commit
d0d7e671ed
1 changed files with 3 additions and 2 deletions
|
@ -738,8 +738,9 @@ class MachineManager(QObject):
|
|||
containers = CuraContainerRegistry.getInstance().findInstanceContainersMetadata(type = "user", machine = machine_id)
|
||||
for container in containers:
|
||||
CuraContainerRegistry.getInstance().removeContainer(container["id"])
|
||||
machine_stack = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine", name = machine_id)[0]
|
||||
CuraContainerRegistry.getInstance().removeContainer(machine_stack.definitionChanges.getId())
|
||||
machine_stacks = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine", name = machine_id)
|
||||
if machine_stacks:
|
||||
CuraContainerRegistry.getInstance().removeContainer(machine_stacks[0].definitionChanges.getId())
|
||||
CuraContainerRegistry.getInstance().removeContainer(machine_id)
|
||||
|
||||
# If the printer that is being removed is a network printer, the hidden printers have to be also removed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue