diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 96c511bccb..5e384d1d03 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -328,14 +328,15 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): def _stopCamera(self): if self._camera_timer.isActive(): self._camera_timer.stop() - if self._image_reply: - try: - self._image_reply.abort() - self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress) - except RuntimeError: - pass # It can happen that the wrapped c++ object is already deleted. - self._image_reply = None - self._image_request = None + + if self._image_reply: + try: + self._image_reply.abort() + self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress) + except RuntimeError: + pass # It can happen that the wrapped c++ object is already deleted. + self._image_reply = None + self._image_request = None def _startCamera(self): if self._use_stream: