From 70e6c8093ed56db8bcb50b40a140d7ffe5e4d0da Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Jun 2016 14:19:18 +0200 Subject: [PATCH] Explicitly return None if no global container stack That's what it does. This is more clear than doing 'pass' or something. Contributes to issues CURA-340 and CURA-1278. --- cura/ExtruderManager.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cura/ExtruderManager.py b/cura/ExtruderManager.py index ccf8a3ad40..ff29165df5 100644 --- a/cura/ExtruderManager.py +++ b/cura/ExtruderManager.py @@ -51,11 +51,12 @@ class ExtruderManager(QObject): @pyqtProperty(str, notify = activeExtruderChanged) def activeExtruderStackId(self): - if UM.Application.getInstance().getGlobalContainerStack(): - try: - return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)] - except KeyError: - pass + if not UM.Application.getInstance().getGlobalContainerStack(): + return None #Whatta ya gonna do? + try: + return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)] + except KeyError: + return None @pyqtSlot(int) def setActiveExtruderIndex(self, index):