mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4997 from GogoVega/fix-def-import
Fix def can be undefined if the type is missing
This commit is contained in:
commit
ed0399b855
@ -2379,13 +2379,13 @@ RED.nodes = (function() {
|
||||
node.type = "unknown";
|
||||
}
|
||||
if (node._def.category != "config") {
|
||||
if (n.hasOwnProperty('inputs') && def.defaults.hasOwnProperty("inputs")) {
|
||||
if (n.hasOwnProperty('inputs') && node._def.defaults.hasOwnProperty("inputs")) {
|
||||
node.inputs = parseInt(n.inputs, 10);
|
||||
node._config.inputs = JSON.stringify(n.inputs);
|
||||
} else {
|
||||
node.inputs = node._def.inputs;
|
||||
}
|
||||
if (n.hasOwnProperty('outputs') && def.defaults.hasOwnProperty("outputs")) {
|
||||
if (n.hasOwnProperty('outputs') && node._def.defaults.hasOwnProperty("outputs")) {
|
||||
node.outputs = parseInt(n.outputs, 10);
|
||||
node._config.outputs = JSON.stringify(n.outputs);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user