From 699140320393b63a18b9c030691344e3e0f923d1 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 3 Aug 2020 23:26:41 +0200 Subject: [PATCH] Fix location editor in onboarding (#6512) --- src/components/map/ha-location-editor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/map/ha-location-editor.ts b/src/components/map/ha-location-editor.ts index be72287b3e..a1775f1a58 100644 --- a/src/components/map/ha-location-editor.ts +++ b/src/components/map/ha-location-editor.ts @@ -107,7 +107,7 @@ class LocationEditor extends LitElement { if (changedProps.has("hass")) { const oldHass = changedProps.get("hass") as HomeAssistant | undefined; - if (!oldHass || oldHass.themes.darkMode === this.hass.themes.darkMode) { + if (!oldHass || oldHass.themes?.darkMode === this.hass.themes?.darkMode) { return; } if (!this._leafletMap || !this._tileLayer) { @@ -117,7 +117,7 @@ class LocationEditor extends LitElement { this.Leaflet, this._leafletMap, this._tileLayer, - this.hass.themes.darkMode + this.hass.themes?.darkMode ); } } @@ -129,7 +129,7 @@ class LocationEditor extends LitElement { private async _initMap(): Promise { [this._leafletMap, this.Leaflet, this._tileLayer] = await setupLeafletMap( this._mapEl, - this.hass.themes.darkMode, + this.hass.themes?.darkMode, Boolean(this.radius) ); this._leafletMap.addEventListener(