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

Don't allow tabs or subflows to be added with new flow

This commit is contained in:
Nick O'Leary 2015-12-14 10:46:54 +00:00
parent da0ce9fe0d
commit 4d0950215f

View File

@ -402,6 +402,9 @@ function addFlow(flow) {
// TODO nls // TODO nls
return when.reject(new Error('duplicate id')); return when.reject(new Error('duplicate id'));
} }
if (node.type === 'tab' || node.type === 'subflow') {
return when.reject(new Error('invalid node type: '+node.type));
}
node.z = flow.id; node.z = flow.id;
nodes.push(node); nodes.push(node);
} }
@ -412,6 +415,9 @@ function addFlow(flow) {
// TODO nls // TODO nls
return when.reject(new Error('duplicate id')); return when.reject(new Error('duplicate id'));
} }
if (node.type === 'tab' || node.type === 'subflow') {
return when.reject(new Error('invalid node type: '+node.type));
}
node.z = flow.id; node.z = flow.id;
nodes.push(node); nodes.push(node);
} }