cryptocoinjs / hdkey

JavaScript component for Bitcoin hierarchical deterministic keys (BIP32)
MIT License
201 stars 74 forks source link

privateExtendedKey error handling #7

Closed axic closed 8 years ago

axic commented 8 years ago

Calling privateExtendedKey on a public node will result in the following exception: TypeError: Cannot read property 'length' of null

I think it would be nice either adding an assert into the function with a proper message or to return null.

In comparison privateKey just returns null if it is not available, perhaps that should be followed.

axic commented 8 years ago

@jprichardson any comments on this?

jprichardson commented 8 years ago

@jprichardson any comments on this?

Ooops, sorry. Not sure how I missed this.

I'm thinking it should just return null? Thoughts?

axic commented 8 years ago

I think that's the best option.

axic commented 8 years ago

@jprichardson ping 😃

jprichardson commented 8 years ago

Fixed. Published. Sorry about the delay!

axic commented 8 years ago

Thanks!