Merge pull request #4997 from GogoVega/fix-def-import

Fix def can be undefined if the type is missing
This commit is contained in:
Nick O'Leary 2024-12-17 17:04:52 +00:00 committed by GitHub
commit ed0399b855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {