From 82a6b06cfbf8ceb3ade9435202963396809b3cd8 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 9 May 2017 20:34:53 -0700 Subject: [PATCH] Ensure a null condition is not wrapped in a list --- panels/automation/ha-automation-editor.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panels/automation/ha-automation-editor.html b/panels/automation/ha-automation-editor.html index 3a05ded576..cf7fb1b356 100644 --- a/panels/automation/ha-automation-editor.html +++ b/panels/automation/ha-automation-editor.html @@ -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;