mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Don't connect when aborting while the signal is not yet connected
Do this using try-except so that it is thread safe.
This commit is contained in:
parent
d68b44791b
commit
33e49bebbe
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue