mappum / webcoin

:globe_with_meridians::moneybag: SPV Bitcoin client for Node.js and the browser
412 stars 60 forks source link

Uncaught TypeError: Cannot read property 'message' of null #16

Closed paulkernfeld closed 8 years ago

paulkernfeld commented 8 years ago

I got this error on the following line of code, lib/node.js line 160 or so, presumably because err is null. I saw this while running a browserified version of bin/wallet.js.

if (err !== true && !(err.message === 'Database is not open' && self.closing)) {

I'm happy to send a PR to fix this, but I'm a little confused by the way the err variable is working. What does err = true mean here? It sort of seems like err = true isn't actually an error.

mappum commented 8 years ago

The current Node code is being replaced, so this error shouldn't be relevant anymore.

But just to to answer your question, I was setting the err to true as a way to break execution from async tasks (using the async module), since the tasks stop executing on the first error).