1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Warn if a node references an unknown config node type

Closes #709
This commit is contained in:
Nick O'Leary 2015-09-25 23:17:57 +01:00
parent c0b8f5e3e1
commit 4a0222bd1c

View File

@ -572,10 +572,15 @@ RED.editor = (function() {
if (definition.defaults.hasOwnProperty(d)) { if (definition.defaults.hasOwnProperty(d)) {
if (definition.defaults[d].type) { if (definition.defaults[d].type) {
var configTypeDef = RED.nodes.getType(definition.defaults[d].type); var configTypeDef = RED.nodes.getType(definition.defaults[d].type);
if (configTypeDef && configTypeDef.exclusive) { if (configTypeDef) {
prepareConfigNodeButton(node,d,definition.defaults[d].type); if (configTypeDef.exclusive) {
prepareConfigNodeButton(node,d,definition.defaults[d].type);
} else {
prepareConfigNodeSelect(node,d,definition.defaults[d].type);
}
} else { } else {
prepareConfigNodeSelect(node,d,definition.defaults[d].type); console.log("Unknown type:", definition.defaults[d].type);
preparePropertyEditor(node,d,prefix);
} }
} else { } else {
preparePropertyEditor(node,d,prefix); preparePropertyEditor(node,d,prefix);