mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Ensure a null condition is not wrapped in a list
This commit is contained in:
parent
ca82a411aa
commit
82a6b06cfb
@ -163,8 +163,9 @@ Polymer({
|
|||||||
// Normalize data: ensure trigger, action and condition are lists
|
// Normalize data: ensure trigger, action and condition are lists
|
||||||
// Happens when people copy paste their automations into the config
|
// Happens when people copy paste their automations into the config
|
||||||
['trigger', 'condition', 'action'].forEach(function (key) {
|
['trigger', 'condition', 'action'].forEach(function (key) {
|
||||||
if (!Array.isArray(config[key])) {
|
var value = config[key];
|
||||||
config[key] = [config[key]];
|
if (value && !Array.isArray(value)) {
|
||||||
|
config[key] = [value];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.dirty = false;
|
this.dirty = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user