mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:19:04 +08: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,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…
x
Reference in New Issue
Block a user