Fix hang on partial deploy with disconnected mqtt node

pull/911/head
Nick O'Leary 2016-04-18 13:54:05 +01:00
parent 4bc482bc85
commit 627a80419a
1 changed files with 4 additions and 1 deletions

View File

@ -143,8 +143,11 @@ module.exports = function(RED) {
return done(); return done();
} }
if (Object.keys(node.users).length === 0) { if (Object.keys(node.users).length === 0) {
if (node.client) { if (node.client && node.client.connected) {
return node.client.end(done); return node.client.end(done);
} else {
node.client.end();
done();
} }
} }
done(); done();