From b2aea4da2983a768513899505f3014f577dc7515 Mon Sep 17 00:00:00 2001 From: Olivier Verhaegen <56387556+OlivierVerhaegen@users.noreply.github.com> Date: Mon, 17 Apr 2023 11:19:40 +0200 Subject: [PATCH] If not connected, do not try to disconnect --- io/stomp/18-stomp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/stomp/18-stomp.js b/io/stomp/18-stomp.js index 722aaacd..17cb721f 100644 --- a/io/stomp/18-stomp.js +++ b/io/stomp/18-stomp.js @@ -248,8 +248,8 @@ module.exports = function(RED) { if (!node.client) { node.warn("Can't disconnect, connection not initialized."); callback(); - } else if (node.closing) { - // Disconnection already in progress + } else if (node.closing || !node.connected) { + // Disconnection already in progress or not connected callback(); } else { waitDisconnect(node.client, 2000).then(() => {