Fix def can be undefined if the type is missing

pull/4997/head
GogoVega 2024-12-17 17:57:01 +01:00
parent 7a3741165b
commit c6895713ed
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B
1 changed files with 2 additions and 2 deletions

View File

@ -2357,13 +2357,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 {