Only add extrudernr to used extruders if it actually exists

This can cause issues when a profile got messed up (especially when using profiles between different custom machines)
This commit is contained in:
Jaime van Kessel 2019-05-16 15:41:52 +02:00
parent 186eef0b68
commit 915e0e2047

View file

@ -279,7 +279,8 @@ class ExtruderManager(QObject):
extruder_str_nr = str(global_stack.getProperty("adhesion_extruder_nr", "value"))
if extruder_str_nr == "-1":
extruder_str_nr = self._application.getMachineManager().defaultExtruderPosition
used_extruder_stack_ids.add(self.extruderIds[extruder_str_nr])
if extruder_str_nr in self.extruderIds:
used_extruder_stack_ids.add(self.extruderIds[extruder_str_nr])
try:
return [container_registry.findContainerStacks(id = stack_id)[0] for stack_id in used_extruder_stack_ids]