lightningd / clightningjs

C-lightning plugins in Javascript
MIT License
25 stars 13 forks source link

Allow option default value 0 #10

Closed MrHash closed 3 years ago

MrHash commented 3 years ago

When adding a plugin option of integer type with a default value of 0, the plugin evaluates this as false and the plugin is killed. The following line is where the error arises: https://github.com/lightningd/clightningjs/blob/master/src/plugin.js#L131. This seems to arise since the clightning v0.9.3 release.

Probably it's better to check explicitly for null values?

darosior commented 3 years ago

Yeah, definitely. Will take a look ASAP but happy to review a PR too (@anyonereadingthis)

MrHash commented 3 years ago

ok i'll post a PR later

darosior commented 3 years ago

Fixed by #11