From e0ceaba6559ee47a76e2d484de0c2b3fe19ba55d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 25 Jun 2018 16:47:23 -0400 Subject: [PATCH] fix `blob_list` raising an error when blobs in a stream haven't yet been created --- CHANGELOG.md | 4 ++-- lbrynet/daemon/Daemon.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c2cec3f5..d970fa4b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,8 @@ at anytime. * ### Fixed - * Fixed a scenario where stopping downloads raises `NoneType object has no attribute finished_deferred`. - * + * `blob_list` raising an error when blobs in a stream haven't yet been created + * stopping a download from raising `NoneType object has no attribute finished_deferred` ### Deprecated * diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index db2726208..583824074 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -3034,8 +3034,10 @@ class Daemon(AuthJSONRPCServer): sd_hash = yield self.session.storage.get_sd_blob_hash_for_stream(stream_hash) if stream_hash: crypt_blobs = yield self.session.storage.get_blobs_for_stream(stream_hash) - blobs = [self.session.blob_manager.blobs[crypt_blob.blob_hash] for crypt_blob in crypt_blobs - if crypt_blob.blob_hash is not None] + blobs = yield defer.gatherResults([ + self.session.blob_manager.get_blob(crypt_blob.blob_hash, crypt_blob.length) + for crypt_blob in crypt_blobs if crypt_blob.blob_hash is not None + ]) else: blobs = [] # get_blobs_for_stream does not include the sd blob, so we'll add it manually