Apollon77/smartmeter-obis

Uncaptured closure in SerialResponseTransport

Closed this issue · 4 comments

Form time to time I get an error in line 223 of SerialResponseTransport.js. This might be caused by an issue in the underlying serial library. But this error will not be handled correctly:

if (this.serialComm) this.serialComm.close(function(err) { if (err) { this.options.logger('ERROR CLOSING SERIALPORT'); } });

this.options didn't exist in case of invoking the callback function. It has to be captured in a closure before.

Do you accept a PR?

Sure. PRs are welcome ;-) I will also take a look later ...

I do not nee a PR ... fixed it hopefully. WIll publish new version soon

1.1.3 on npm

Thx!