Skip to content

Commit

Permalink
Check if stravaTokens exist before comparing and setting the previous…
Browse files Browse the repository at this point in the history
… token.
  • Loading branch information
igoramadas committed Sep 19, 2023
1 parent cf43511 commit 747af88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ export class Users {
}

// User has changed the access token? Update the previous one.
if (stravaTokens.accessToken != existingData.stravaTokens.accessToken) {
if (existingData.stravaTokens?.accessToken != stravaTokens.accessToken) {
userData.stravaTokens.previousAccessToken = stravaTokens.accessToken
}

Expand Down

0 comments on commit 747af88

Please sign in to comment.