mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
Add check for callback existance
This commit is contained in:
parent
2bbd0a8a90
commit
9f2dd09f66
1 changed files with 3 additions and 1 deletions
|
|
@ -431,7 +431,9 @@ SerialPort.prototype.close = function (callback) {
|
|||
self.serialPoller.close();
|
||||
}
|
||||
|
||||
callback();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} catch (ex) {
|
||||
self.closing = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue