From f2999c30f35794bac55662a0a83fd5a23ca29472 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Mon, 9 Sep 2019 11:31:20 -0500 Subject: [PATCH] Filter null badges (#3645) * Convert weather-forecast to LitElement Part of https://github.com/home-assistant/home-assistant-polymer/issues/2095 Not sure how RTL works and how to apply it. Also, thinking I should update if the forecast changes and not just the state. Input? * Revert "Convert weather-forecast to LitElement" This reverts commit e1893b0a83f5973df7a28e5d30c3d4d0496155a1. * Filter out null badges Closes https://github.com/home-assistant/home-assistant-polymer/issues/2974 * address review comments * Update hui-view.ts --- src/panels/lovelace/hui-view.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/hui-view.ts b/src/panels/lovelace/hui-view.ts index 811ed0405d..34851f81f2 100644 --- a/src/panels/lovelace/hui-view.ts +++ b/src/panels/lovelace/hui-view.ts @@ -264,7 +264,8 @@ export class HUIView extends LitElement { } const elements: HUIView["_badges"] = []; - const badges = processConfigEntities(config.badges); + // It's possible that a null value was stored as a badge entry + const badges = processConfigEntities(config.badges.filter(Boolean)); for (const badge of badges) { const element = document.createElement("ha-state-label-badge"); const entityId = badge.entity;