From a35f665201a79b8975635b1ff0d60473bf08b1a6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 19 Dec 2017 10:45:38 +0100 Subject: [PATCH] Fixed crash if the firmware was in the list, but not found. CL-541 --- plugins/USBPrinting/USBPrinterOutputDeviceManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py index e13d8cef39..c97d8c0160 100644 --- a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py +++ b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py @@ -135,7 +135,11 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension): Logger.log("w", "There is no firmware for machine %s.", machine_id) if hex_file: - return Resources.getPath(CuraApplication.ResourceTypes.Firmware, hex_file.format(baudrate=baudrate)) + try: + return Resources.getPath(CuraApplication.ResourceTypes.Firmware, hex_file.format(baudrate=baudrate)) + except FileNotFoundError: + Logger.log("w", "Could not find any firmware for machine %s.", machine_id) + return "" else: Logger.log("w", "Could not find any firmware for machine %s.", machine_id) return ""