holepunchto / hyperdht

The DHT powering Hyperswarm
https://docs.holepunch.to
MIT License
323 stars 46 forks source link

fix: fix address undefined error #78

Closed gmaclennan closed 2 years ago

gmaclennan commented 2 years ago

I came across this error when creating a DHT on a local network. If addr.host is a private or bogon address, then address can end up being null (because for some reason reply is null the first time that connect() is called), which results in an uncaught error.

mafintosh commented 2 years ago

I think the from === null thing is a bug actually

gmaclennan commented 2 years ago

Yeah thought it might be. I'm afraid I don't really know enough about the internals to fix that one.

mafintosh commented 2 years ago

Should be fixed in master now