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 14f6788ab9
commit 70cf7b0c5a
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 13 additions and 11 deletions

View File

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