diff --git a/CHANGELOG.md b/CHANGELOG.md index 729427e9d..5839373bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ at anytime. * fixed token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248) * fixed a race condition when inserting a blob into the database (https://github.com/lbryio/lbry/issues/1129) * reflector server incorrectly responding as if it has all the blobs for a stream that was only partially uploaded to it + * `publish` raising a database error when updating a claim that we don't have a file for (https://github.com/lbryio/lbry/issues/1165) ### Deprecated * diff --git a/lbrynet/daemon/Publisher.py b/lbrynet/daemon/Publisher.py index 283e478a9..3dc01664c 100644 --- a/lbrynet/daemon/Publisher.py +++ b/lbrynet/daemon/Publisher.py @@ -59,8 +59,10 @@ class Publisher(object): def publish_stream(self, name, bid, claim_dict, stream_hash, claim_address=None, change_address=None): """Make a claim without creating a lbry file""" claim_out = yield self.make_claim(name, bid, claim_dict, claim_address, change_address) - yield self.session.storage.save_content_claim(stream_hash, "%s:%i" % (claim_out['txid'], claim_out['nout'])) - self.lbry_file = [f for f in self.lbry_file_manager.lbry_files if f.stream_hash == stream_hash][0] + if stream_hash: # the stream_hash returned from the db will be None if this isn't a stream we have + yield self.session.storage.save_content_claim(stream_hash, "%s:%i" % (claim_out['txid'], + claim_out['nout'])) + self.lbry_file = [f for f in self.lbry_file_manager.lbry_files if f.stream_hash == stream_hash][0] defer.returnValue(claim_out) @defer.inlineCallbacks