mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 06:03:57 -06:00
Don't crash when switching to printer with fewer extruders
This seems to have happened with an UM2+C. Fixes Sentry issue CURA-2R5.
This commit is contained in:
parent
fe640d42cf
commit
58f4d44694
1 changed files with 3 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2020 Ultimaker B.V.
|
# Copyright (c) 2021 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
@ -1398,6 +1398,8 @@ class MachineManager(QObject):
|
||||||
# previous one).
|
# previous one).
|
||||||
self._global_container_stack.setUserChanges(global_user_changes)
|
self._global_container_stack.setUserChanges(global_user_changes)
|
||||||
for i, user_changes in enumerate(per_extruder_user_changes):
|
for i, user_changes in enumerate(per_extruder_user_changes):
|
||||||
|
if i >= len(self._global_container_stack.extruderList): # New printer has fewer extruders.
|
||||||
|
break
|
||||||
self._global_container_stack.extruderList[i].setUserChanges(per_extruder_user_changes[i])
|
self._global_container_stack.extruderList[i].setUserChanges(per_extruder_user_changes[i])
|
||||||
|
|
||||||
@pyqtSlot(QObject)
|
@pyqtSlot(QObject)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue