Skip to content

Commit

Permalink
Merge pull request #205 from nb/no-weight-perf-predictor-crash
Browse files Browse the repository at this point in the history
Avoid Perf Predictor crashing if rider has no weight
  • Loading branch information
mayfield authored Oct 4, 2024
2 parents 0aa49f3 + 0bdf367 commit 6e27d80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/site/analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2876,7 +2876,7 @@ sauce.ns('analysis', ns => {
power: power && Math.round(power),
hasWeight: !!ns.weight,
wkg: power && ns.weight && H.number(power / ns.weight, {fixed: true, precision: 1}),
bodyWeight: L.weightFormatter.convert(ns.weight).toFixed(1),
bodyWeight: ns.weight && L.weightFormatter.convert(ns.weight).toFixed(1),
gearWeight: L.weightFormatter.convert(bikeDefaults.gearWeight).toFixed(1),
slope: (slope * 100).toFixed(1),
distance: L.distanceFormatter.convert(origDistance).toFixed(3),
Expand Down

0 comments on commit 6e27d80

Please sign in to comment.