From 216dbc4d41830ac9bfde5655b2d0fbfff4c2d917 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 2 Sep 2024 13:21:13 +0200 Subject: [PATCH] Fix section not displayed when empty and string config (#21852) --- src/panels/lovelace/sections/hui-grid-section.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/sections/hui-grid-section.ts b/src/panels/lovelace/sections/hui-grid-section.ts index 349521228b..fdf9317d73 100644 --- a/src/panels/lovelace/sections/hui-grid-section.ts +++ b/src/panels/lovelace/sections/hui-grid-section.ts @@ -48,7 +48,10 @@ export class GridSection extends LitElement implements LovelaceSectionElement { private _cardConfigKeys = new WeakMap(); private _getKey(cardConfig: LovelaceCardConfig) { - if (!this._cardConfigKeys.has(cardConfig)) { + if ( + !this._cardConfigKeys.has(cardConfig) && + typeof cardConfig === "object" + ) { this._cardConfigKeys.set(cardConfig, Math.random().toString()); } return this._cardConfigKeys.get(cardConfig)!;