From ec1500860f402106525bc0b85eeb8fe457604c19 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 7 Apr 2015 15:19:44 +0200 Subject: [PATCH] fixed exceptions caused by disconnecting printer --- PrinterApplication.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PrinterApplication.py b/PrinterApplication.py index 0fad7d5fc9..c7b71668d3 100644 --- a/PrinterApplication.py +++ b/PrinterApplication.py @@ -288,8 +288,9 @@ class PrinterApplication(QtApplication): self.outputDevicesChanged.emit() def removeOutputDevice(self, id): - del self._output_devices[id] - self.outputDevicesChanged.emit() + if id in self._output_devices: + del self._output_devices[id] + self.outputDevicesChanged.emit() @pyqtSlot(str) def writeToOutputDevice(self, device):