Fix section not displayed when empty and string config (#21852)

This commit is contained in:
Paul Bottein 2024-09-02 13:21:13 +02:00 committed by GitHub
parent c40751dadd
commit 216dbc4d41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,10 @@ export class GridSection extends LitElement implements LovelaceSectionElement {
private _cardConfigKeys = new WeakMap<LovelaceCardConfig, string>();
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)!;