diff --git a/src/nodeClass.js b/src/nodeClass.js index d92c73f..53c0de7 100644 --- a/src/nodeClass.js +++ b/src/nodeClass.js @@ -264,7 +264,7 @@ try{ } catch (error) { this.node.error(`Error handling input (${msg?.topic}): ${error?.message || error}`); } finally { - done(); + if (typeof done === 'function') done(); } }); } @@ -276,7 +276,7 @@ try{ this.node.on('close', (done) => { clearInterval(this._tickInterval); clearInterval(this._statusInterval); - done(); + if (typeof done === 'function') done(); }); } }