From f0a9185e4ac191a00ee5a5ca3c08d8ec7dae9ac7 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 8 Feb 2024 18:31:23 +0100 Subject: [PATCH] handle undefined and null in cast --- cast/src/receiver/layout/hc-lovelace.ts | 2 +- cast/src/receiver/layout/hc-main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cast/src/receiver/layout/hc-lovelace.ts b/cast/src/receiver/layout/hc-lovelace.ts index 01b6f03fb0..d748b8184e 100644 --- a/cast/src/receiver/layout/hc-lovelace.ts +++ b/cast/src/receiver/layout/hc-lovelace.ts @@ -93,7 +93,7 @@ class HcLovelace extends LitElement { } private get _viewIndex() { - if (this.viewPath === null) { + if (this.viewPath === null || this.viewPath === undefined) { return 0; } const selectedView = this.viewPath; diff --git a/cast/src/receiver/layout/hc-main.ts b/cast/src/receiver/layout/hc-main.ts index 64b821817a..cc0f3bc48f 100644 --- a/cast/src/receiver/layout/hc-main.ts +++ b/cast/src/receiver/layout/hc-main.ts @@ -270,7 +270,7 @@ export class HcMain extends HassElement { } this._error = undefined; - if (msg.urlPath === "lovelace") { + if (msg.urlPath === "lovelace" || msg.urlPath === undefined) { msg.urlPath = null; } this._lovelacePath = msg.viewPath;