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)!;