This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 300
ipfs.dht.findProvs() can't catch error with fake hash #928
Labels
Comments
@Dendiom would you be willing to submit a PR to callback with an empty array if |
Looks like this still does not handle the case where
When |
@KrishnaPG are you able to submit a fix for this? |
alanshaw
pushed a commit
that referenced
this issue
May 17, 2019
Correcting the array check to happen before the individual element checks. fixes #928
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We want to implement a 'exist' function to judge if provided hash is exist in the private ipfs network. We use ipfs.dht.findProvs() to achieve this logic like this:
but we found that if the hash is valid but not exist, it will throw an error that can't catch in promise:
Uncaught TypeError: Cannot read property 'Type' of undefined
after see the source code, we found this:
It means that the res is undefined when hash is not exist?
or would you please give us a better way to achieve the 'exist' function
The text was updated successfully, but these errors were encountered: