diff --git a/lib/query-stream.js b/lib/query-stream.js index 6b104fc..1fbafff 100644 --- a/lib/query-stream.js +++ b/lib/query-stream.js @@ -49,7 +49,7 @@ class QueryStream extends Readable { _onresponse (err, message, peer, request, to, type) { this.inflight-- - if (err && to.id) { + if (err && to && to.id) { // Request, including retries, failed completely // Remove the "to" node. const node = this._node.bucket.get(to.id)