Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
fix(live-feed): fix error during initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Oct 25, 2020
1 parent 42fd379 commit 2405056
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/app/live-feed/live-feed.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,14 @@ export class LiveFeedPage implements OnInit, OnDestroy {
winner: undefined,
};

const day = this.streamData.games.sim.day;
const round = this.streamData.sim.playOffRound;
const phase = this.streamData.sim.phase;
if (!this.streamData && !this.streamData.sim) {
return;
}

const day = this.streamData?.games?.sim?.day;
const round = this.streamData?.sim?.playOffRound;
const phase = this.streamData?.sim?.phase;

switch (phase) {
case PHASES.PRESEASON:
case PHASES.PRE_ELECTION:
Expand Down Expand Up @@ -370,7 +375,7 @@ export class LiveFeedPage implements OnInit, OnDestroy {
break;
}
default:
uiState.seasonHeader = `Season ${this.streamData.games.season.seasonNumber}, Day ${day}`;
uiState.seasonHeader = `Season ${this.streamData?.games?.season?.seasonNumber}, Day ${day}`;
break;
}

Expand Down

0 comments on commit 2405056

Please sign in to comment.