diff --git a/src/dht/findprovs.js b/src/dht/findprovs.js index 183adfa93..84c1df8f9 100644 --- a/src/dht/findprovs.js +++ b/src/dht/findprovs.js @@ -44,11 +44,13 @@ module.exports = (send) => { const responses = res.Responses.map((r) => { const peerInfo = new PeerInfo(PeerId.createFromB58String(r.ID)) - r.Addrs.forEach((addr) => { - const ma = multiaddr(addr) + if (r.Addrs) { + r.Addrs.forEach((addr) => { + const ma = multiaddr(addr) - peerInfo.multiaddrs.add(ma) - }) + peerInfo.multiaddrs.add(ma) + }) + } return peerInfo })