From f71b23c72aadf3b179e81d5fc691da164b8af1e7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Oct 2016 09:35:31 +0200 Subject: [PATCH] Added handling for if there is no global stack CURA-2475 --- DiscoverUM3Action.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DiscoverUM3Action.py b/DiscoverUM3Action.py index 8213812391..7d7484f7af 100644 --- a/DiscoverUM3Action.py +++ b/DiscoverUM3Action.py @@ -75,7 +75,11 @@ class DiscoverUM3Action(MachineAction): @pyqtProperty("QVariantList", notify = printersChanged) def foundDevices(self): if self._network_plugin: - global_printer_type = Application.getInstance().getGlobalContainerStack().getBottom().getId() + if Application.getInstance().getGlobalContainerStack(): + global_printer_type = Application.getInstance().getGlobalContainerStack().getBottom().getId() + else: + global_printer_type = "unknown" + printers = list(self._network_plugin.getPrinters().values()) # TODO; There are still some testing printers that don't have a correct printer type, so don't filter out unkown ones just yet. printers = [printer for printer in printers if printer.printerType == global_printer_type or printer.printerType == "unknown"]