mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +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
|
||||
// Happens when people copy paste their automations into the config
|
||||
['trigger', 'condition', 'action'].forEach(function (key) {
|
||||
if (!Array.isArray(config[key])) {
|
||||
config[key] = [config[key]];
|
||||
var value = config[key];
|
||||
if (value && !Array.isArray(value)) {
|
||||
config[key] = [value];
|
||||
}
|
||||
});
|
||||
this.dirty = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user