Skip to content

Commit

Permalink
fix: the hass object could sometimes be null
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Oct 24, 2021
1 parent d38fd6e commit ff27baf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apexcharts-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class ChartsCard extends LitElement {
}

private _updateOnInterval(): void {
if (!this._updating) {
if (!this._updating && this.hass) {
this._updating = true;
this._updateData();
}
Expand Down Expand Up @@ -219,7 +219,7 @@ class ChartsCard extends LitElement {

public set hass(hass: HomeAssistant) {
this._hass = hass;
if (!this._config || !this._graphs) return;
if (!this._config || !this._graphs || !hass) return;

this._graphs.map((graph) => {
if (graph) graph.hass = hass;
Expand Down

0 comments on commit ff27baf

Please sign in to comment.