From 41a07c000d9bbe778ca5f5e97d604267bdf4e6f3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 25 Apr 2016 10:24:15 +0200 Subject: [PATCH] Added extra status catching for when active machine instance is None CURA-49 --- NetworkPrinterOutputDevicePlugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NetworkPrinterOutputDevicePlugin.py b/NetworkPrinterOutputDevicePlugin.py index ac0c55a0b0..b4e2b6a014 100644 --- a/NetworkPrinterOutputDevicePlugin.py +++ b/NetworkPrinterOutputDevicePlugin.py @@ -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()