Check before removing

Cura shouldn't crash when the abstract machine isn't in the other_machine_stack
This commit is contained in:
jspijker 2023-01-13 13:30:09 +01:00
parent 5542eec0c4
commit fe4679e4e8

View file

@ -115,7 +115,9 @@ class MachineListModel(ListModel):
online_machine_stacks = list(filter(lambda machine: machine.hasNetworkedConnection(), online_machine_stacks))
online_machine_stacks.sort(key=lambda machine: machine.getName().upper())
other_machine_stacks.remove(abstract_machine)
if abstract_machine in other_machine_stacks:
other_machine_stacks.remove(abstract_machine)
if abstract_machine in online_machine_stacks:
online_machine_stacks.remove(abstract_machine)