Prevent node z property getting set to 0 or ""

This commit is contained in:
Nick O'Leary 2020-10-19 13:24:04 +01:00
parent e8e44f9a32
commit dc26022fb4
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 6 additions and 0 deletions

View File

@ -553,6 +553,9 @@ RED.nodes = (function() {
node.id = n.id; node.id = n.id;
node.type = n.type; node.type = n.type;
node.z = n.z; node.z = n.z;
if (node.z === 0 || node.z === "") {
delete node.z;
}
if (n.d === true) { if (n.d === true) {
node.d = true; node.d = true;
} }
@ -1351,6 +1354,9 @@ RED.nodes = (function() {
users:[], users:[],
_config:{} _config:{}
}; };
if (!n.z) {
delete configNode.z;
}
if (n.hasOwnProperty('d')) { if (n.hasOwnProperty('d')) {
configNode.d = n.d; configNode.d = n.d;
} }