libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
80 stars 44 forks source link

fix: catch errors thrown by multihash decode #109

Closed jacobheun closed 4 years ago

jacobheun commented 4 years ago

multihash.decode throws an error, and we are not catching that, this fixes that. We shouldn't need to throw this error. This will occur if no public key exists, and the Id doesn't contain a valid multihash code. The decode was added to unmarshal inline public keys.