From a1d7eefc425d6865115e76ea2c749376764741e9 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Mon, 16 Dec 2019 14:04:16 +0100 Subject: [PATCH] Fix PPA crashing on single-extruder printers The machine manager was leading to a crash when trying to enable the second extruder in single-extrusion printers, because the check for the second extruder was not correctly implemented. This commit fixes that issue by checking if the global stack has the specified extruder. If it does not, then the function returns while logging the issue. CURA-7048 --- cura/Settings/MachineManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index de6e270a86..3167bf78b9 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -894,8 +894,8 @@ class MachineManager(QObject): @pyqtSlot(int, bool) def setExtruderEnabled(self, position: int, enabled: bool) -> None: - if self._global_container_stack is None: - Logger.log("w", "Could not find extruder on position %s", position) + if self._global_container_stack is None or position not in self._global_container_stack.extruders: + Logger.log("w", "Could not find extruder on position %s.", position) return extruder = self._global_container_stack.extruderList[position]