diff --git a/app/services/standings-sync/mls.ts b/app/services/standings-sync/mls.ts index 359edef..e5d91f8 100644 --- a/app/services/standings-sync/mls.ts +++ b/app/services/standings-sync/mls.ts @@ -131,7 +131,7 @@ export class MlsStandingsAdapter implements StandingsSyncAdapter { const playoffSeedStat = sm.get("playoffSeed"); const conferenceRank = - playoffSeedStat?.value != null + playoffSeedStat?.value !== null && playoffSeedStat?.value !== undefined ? Math.round(playoffSeedStat.value) : playoffSeedStat?.displayValue ? parseInt(playoffSeedStat.displayValue, 10) || undefined @@ -146,10 +146,10 @@ export class MlsStandingsAdapter implements StandingsSyncAdapter { wins: Math.round(wins), losses: Math.round(losses), ties: Math.round(ties), - tablePoints: tablePoints != null ? Math.round(tablePoints) : undefined, - goalsFor: goalsFor != null ? Math.round(goalsFor) : undefined, - goalsAgainst: goalsAgainst != null ? Math.round(goalsAgainst) : undefined, - goalDifference: goalDifference != null ? Math.round(goalDifference) : undefined, + tablePoints: tablePoints !== null && tablePoints !== undefined ? Math.round(tablePoints) : undefined, + goalsFor: goalsFor !== null && goalsFor !== undefined ? Math.round(goalsFor) : undefined, + goalsAgainst: goalsAgainst !== null && goalsAgainst !== undefined ? Math.round(goalsAgainst) : undefined, + goalDifference: goalDifference !== null && goalDifference !== undefined ? Math.round(goalDifference) : undefined, winPct: gamesPlayed > 0 ? wins / gamesPlayed : 0, gamesPlayed, conference: normalizeConference(conference),