handle undefined and null in cast

This commit is contained in:
Bram Kragten 2024-02-08 18:31:23 +01:00
parent 3469013f1a
commit f0a9185e4a
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ class HcLovelace extends LitElement {
} }
private get _viewIndex() { private get _viewIndex() {
if (this.viewPath === null) { if (this.viewPath === null || this.viewPath === undefined) {
return 0; return 0;
} }
const selectedView = this.viewPath; const selectedView = this.viewPath;

View File

@ -270,7 +270,7 @@ export class HcMain extends HassElement {
} }
this._error = undefined; this._error = undefined;
if (msg.urlPath === "lovelace") { if (msg.urlPath === "lovelace" || msg.urlPath === undefined) {
msg.urlPath = null; msg.urlPath = null;
} }
this._lovelacePath = msg.viewPath; this._lovelacePath = msg.viewPath;