diff --git a/src/panels/lovelace/cards/hui-calendar-card.ts b/src/panels/lovelace/cards/hui-calendar-card.ts index f72815c5f2..e6ad8abdf1 100644 --- a/src/panels/lovelace/cards/hui-calendar-card.ts +++ b/src/panels/lovelace/cards/hui-calendar-card.ts @@ -94,10 +94,12 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard { (changedProps.has("_config") && this._config?.entities) ) { const computedStyles = getComputedStyle(this); - this._calendars = this._config!.entities.map((entity, idx) => ({ - entity_id: entity, - backgroundColor: getColorByIndex(idx, computedStyles), - })); + if (this._config?.entities) { + this._calendars = this._config.entities.map((entity, idx) => ({ + entity_id: entity, + backgroundColor: getColorByIndex(idx, computedStyles), + })); + } } }