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.
This commit is contained in:
Ghostkeeper 2016-06-06 14:19:18 +02:00
parent d1be5b6c02
commit 70e6c8093e

View file

@ -51,11 +51,12 @@ class ExtruderManager(QObject):
@pyqtProperty(str, notify = activeExtruderChanged) @pyqtProperty(str, notify = activeExtruderChanged)
def activeExtruderStackId(self): def activeExtruderStackId(self):
if UM.Application.getInstance().getGlobalContainerStack(): if not UM.Application.getInstance().getGlobalContainerStack():
return None #Whatta ya gonna do?
try: try:
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)] return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)]
except KeyError: except KeyError:
pass return None
@pyqtSlot(int) @pyqtSlot(int)
def setActiveExtruderIndex(self, index): def setActiveExtruderIndex(self, index):