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

Do not save subflow env vars with blank names

This commit is contained in:
Nick O'Leary 2019-06-14 11:18:07 +01:00
parent 87a815fd6f
commit 04bdcbd490
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -658,17 +658,19 @@ RED.editor = (function() {
list.each(function(i) { list.each(function(i) {
var entry = $(this); var entry = $(this);
var item = entry.data('data'); var item = entry.data('data');
var name = item.parent?item.name:entry.find(".node-input-env-name").val(); var name = (item.parent?item.name:entry.find(".node-input-env-name").val()).trim();
var valueInput = entry.find(".node-input-env-value"); if (name !== "") {
var value = valueInput.typedInput("value"); var valueInput = entry.find(".node-input-env-value");
var type = valueInput.typedInput("type"); var value = valueInput.typedInput("value");
if (!item.parent || (item.parent.value !== value || item.parent.type !== type)) { var type = valueInput.typedInput("type");
var item = { if (!item.parent || (item.parent.value !== value || item.parent.type !== type)) {
name: name, var item = {
type: type, name: name,
value: value type: type,
}; value: value
env.push(item); };
env.push(item);
}
} }
}); });
return env; return env;