Added extra status catching for when active machine instance is None

CURA-49
This commit is contained in:
Jaime van Kessel 2016-04-25 10:24:15 +02:00
parent bc8f8473e5
commit 41a07c000d

View file

@ -28,7 +28,11 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin, SignalEmitter):
self._zero_conf.close()
def _onActiveMachineInstanceChanged(self):
active_machine_key = Application.getInstance().getMachineManager().getActiveMachineInstance().getKey()
try:
active_machine_key = Application.getInstance().getMachineManager().getActiveMachineInstance().getKey()
except AttributeError:
## Active machine instance changed to None. This can happen upon clean start. Simply ignore.
return
for key in self._printers:
if key == active_machine_key:
self._printers[key].connect()