From f77fa26ffe6fd8adcb44c25aff976e83aad1b5da Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Thu, 8 Jan 2026 10:57:46 +0000 Subject: [PATCH] Fix type error for calendar card (#28869) --- src/panels/lovelace/cards/hui-calendar-card.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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), + })); + } } }