From 7e8180fefc06a8f270a5a7f86624c3c264d4205c Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 10 Jun 2019 16:33:45 -0400 Subject: [PATCH] fix attribute error if availability_response field is missing --- lbry/lbry/blob_exchange/client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lbry/lbry/blob_exchange/client.py b/lbry/lbry/blob_exchange/client.py index e9efb3ac6..cbf376946 100644 --- a/lbry/lbry/blob_exchange/client.py +++ b/lbry/lbry/blob_exchange/client.py @@ -125,11 +125,16 @@ class BlobExchangeClientProtocol(asyncio.Protocol): self.peer_port) log.warning(response.to_dict()) return self._blob_bytes_received, self.close() - elif availability_response.available_blobs and \ + elif availability_response and availability_response.available_blobs and \ availability_response.available_blobs != [self.blob.blob_hash]: log.warning("blob availability response doesn't match our request from %s:%i", self.peer_address, self.peer_port) return self._blob_bytes_received, self.close() + elif not availability_response: + log.warning("response from %s:%i did not include an availability response (we requested %s)", + self.peer_address, self.peer_port, blob_hash) + return self._blob_bytes_received, self.close() + if not price_response or price_response.blob_data_payment_rate != 'RATE_ACCEPTED': log.warning("data rate rejected by %s:%i", self.peer_address, self.peer_port) return self._blob_bytes_received, self.close()