mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Misconfigured WebSocket nodes should not register msg handlers
This commit is contained in:
parent
94ee465682
commit
2913e13a30
@ -212,7 +212,9 @@ module.exports = function(RED) {
|
|||||||
this.error(RED._("websocket.errors.missing-conf"));
|
this.error(RED._("websocket.errors.missing-conf"));
|
||||||
}
|
}
|
||||||
this.on('close', function() {
|
this.on('close', function() {
|
||||||
|
if (node.serverConfig) {
|
||||||
node.serverConfig.removeInputNode(node);
|
node.serverConfig.removeInputNode(node);
|
||||||
|
}
|
||||||
node.status({});
|
node.status({});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -224,7 +226,7 @@ module.exports = function(RED) {
|
|||||||
this.server = (n.client)?n.client:n.server;
|
this.server = (n.client)?n.client:n.server;
|
||||||
this.serverConfig = RED.nodes.getNode(this.server);
|
this.serverConfig = RED.nodes.getNode(this.server);
|
||||||
if (!this.serverConfig) {
|
if (!this.serverConfig) {
|
||||||
this.error(RED._("websocket.errors.missing-conf"));
|
return this.error(RED._("websocket.errors.missing-conf"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// TODO: nls
|
// TODO: nls
|
||||||
|
Loading…
x
Reference in New Issue
Block a user