Fix case where aborting a download would cause a crash

This commit is contained in:
Jaime van Kessel 2019-04-08 17:32:43 +02:00
parent bf47bfc4ea
commit 2765122b95

View file

@ -559,7 +559,7 @@ class Toolbox(QObject, Extension):
if self._download_reply:
try:
self._download_reply.downloadProgress.disconnect(self._onDownloadProgress)
except TypeError: # Raised when the method is not connected to the signal yet.
except (TypeError, RuntimeError): # 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