Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Perf Predictor crashing if rider has no weight #205

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

nb
Copy link
Contributor

@nb nb commented Oct 4, 2024

Check if ns.weight exists before converting, otherwise we will get a type error for trying to run toFixed(1) on undefined.

Cheers!

To test:

  • Go to https://www.strava.com/activities/1537067643#38485981109 and click Perf Predictor on any segment.
  • Nothing happens, except an error in the console.
  • When switching to the dev version with the fix below applied, the Perf Predictor shows up with weight field empty, but at least it shows up.

Otherwise we will get a type error for trying to run `toFixed(1)` on
`undefined`.
@mayfield mayfield merged commit 6e27d80 into SauceLLC:master Oct 4, 2024
2 checks passed
@mayfield
Copy link
Collaborator

mayfield commented Oct 4, 2024

Thank you @nb !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants