Merge pull request #1269 from lbryio/fix_stop_nonetype

Fix stop raising `NoneType' object has no attribute 'finished_deferred'
This commit is contained in:
Jack Robison 2018-06-25 16:42:07 -04:00 committed by GitHub
commit a1f3fc9f3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ at anytime.
* *
### Fixed ### Fixed
* * Fixed a scenario where stopping downloads raises `NoneType object has no attribute finished_deferred`.
* *
### Deprecated ### Deprecated

View file

@ -116,8 +116,8 @@ class ClientProtocol(Protocol, TimeoutMixin):
d.errback(err) d.errback(err)
ds.append(d) ds.append(d)
if self._blob_download_request is not None: if self._blob_download_request is not None:
self._blob_download_request.cancel(err)
ds.append(self._blob_download_request.finished_deferred) ds.append(self._blob_download_request.finished_deferred)
self._blob_download_request.cancel(err)
self._blob_download_request = None self._blob_download_request = None
self._downloading_blob = False self._downloading_blob = False
return defer.DeferredList(ds) return defer.DeferredList(ds)