Fix Cast race condition (#3732)

This commit is contained in:
Paulus Schoutsen 2019-09-16 23:42:25 -06:00 committed by Bram Kragten
parent bf343647d4
commit 065e42c8fd

View File

@ -57,7 +57,13 @@ export class HcMain extends HassElement {
`;
}
if (!this._lovelaceConfig || this._lovelacePath === null) {
if (
!this._lovelaceConfig ||
this._lovelacePath === null ||
// Guard against part of HA not being loaded yet.
(this.hass &&
(!this.hass.states || !this.hass.config || !this.hass.services))
) {
return html`
<hc-launch-screen
.hass=${this.hass}