mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 15:25:09 -06:00
Don't update extruders that Cura doesn't have
This is a bit of defensive coding. If the position is out of bounds for Cura it should now ignore those extruders. This could be due to broken firmware, or maybe someone MITM-ing the connection and changing it, or perhaps because the printer was changed while the sync was ongoing? Whatever the cause, it now puts a warning in the log about it and doesn't crash any more. Fixes Sentry issue CURA-156.
This commit is contained in:
parent
59669f6bad
commit
6e2738a254
1 changed files with 3 additions and 0 deletions
|
@ -1396,6 +1396,9 @@ class MachineManager(QObject):
|
|||
|
||||
for extruder_configuration in configuration.extruderConfigurations:
|
||||
position = str(extruder_configuration.position)
|
||||
if int(position) >= len(self._global_container_stack.extruderList):
|
||||
Logger.warning("Received a configuration for extruder {position}, which is out of bounds for this printer.".format(position=position))
|
||||
continue # Remote printer gave more extruders than what Cura had locally, e.g. because the user switched to a single-extruder printer while the sync was being processed.
|
||||
|
||||
# If the machine doesn't have a hotend or material, disable this extruder
|
||||
if int(position) in extruders_to_disable:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue