Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 49b16ec

Browse files
committedMar 10, 2019
fix: dht.findProvs.js handle valid hash but no providers
License: MIT Signed-off-by: Nitin Patel <nitinpatel278@gmail.com>
1 parent d1e99e7 commit 49b16ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/dht/findprovs.js

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ module.exports = (send) => {
2323
}
2424

2525
const handleResult = (res, callback) => {
26+
// callback with an empty array if no providers are found
27+
if (res === null) {
28+
const responses = []
29+
return callback(null, responses)
30+
}
31+
2632
// Inconsistent return values in the browser vs node
2733
if (Array.isArray(res)) {
2834
res = res[0]

0 commit comments

Comments
 (0)