From 33e49bebbed34cc7a18eab33ab0f38ba2fd140d7 Mon Sep 17 00:00:00 2001 From: Ruben D Date: Thu, 31 May 2018 10:59:17 +0200 Subject: [PATCH] Don't connect when aborting while the signal is not yet connected Do this using try-except so that it is thread safe. --- plugins/Toolbox/src/Toolbox.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index b019dfccbe..13daeced2c 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -404,7 +404,10 @@ class Toolbox(QObject, Extension): def resetDownload(self) -> None: if self._download_reply: - self._download_reply.downloadProgress.disconnect(self._onDownloadProgress) + try: + self._download_reply.downloadProgress.disconnect(self._onDownloadProgress) + except TypeError: #Raised when the method is not connected to the signal yet. + pass #Don't need to disconnect. self._download_reply.abort() self._download_reply = None self._download_request = None