Skip to content

Commit

Permalink
Update telemetry.js
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchyvr committed Nov 19, 2023
1 parent 5525618 commit 1ccea35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/telemetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class Telemetry {
const defaultId = 'Unknown'

// Safely access nested properties
const accountId = this.sessionInfo?.DriverInfo?.Drivers?.[this.sessionInfo.DriverInfo.DriverCarIdx]?.UserID ?? defaultId
const accountId = this.sessionInfo && this.sessionInfo.DriverInfo && this.sessionInfo.DriverInfo.Drivers && this.sessionInfo.DriverInfo.Drivers[this.sessionInfo.DriverInfo.DriverCarIdx]
? this.sessionInfo.DriverInfo.Drivers[this.sessionInfo.DriverInfo.DriverCarIdx].UserID
: defaultId
const sessionId = this.sessionInfo?.WeekendInfo?.SessionID ?? defaultId
const subSessionId = this.sessionInfo?.WeekendInfo?.SubSessionID ?? defaultId

Expand Down

0 comments on commit 1ccea35

Please sign in to comment.