diff options
author | Chris Schlaeger <chris@linux.com> | 2019-09-21 14:11:51 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2019-09-21 14:11:51 +0200 |
commit | f19f1b6d86e31392147bf2e96197cfcb771ee34d (patch) | |
tree | 9681e8b5bf1c7bf6ab39eefbf766f24bd330a6c5 | |
parent | ebd7935ea32e0179325cfc6edf2106d160c93cb9 (diff) | |
download | postrunner-f19f1b6d86e31392147bf2e96197cfcb771ee34d.zip |
Not all FIT files have a user_profile section.
-rw-r--r-- | lib/postrunner/UserProfileView.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/postrunner/UserProfileView.rb b/lib/postrunner/UserProfileView.rb index e5e37b0..4d45d94 100644 --- a/lib/postrunner/UserProfileView.rb +++ b/lib/postrunner/UserProfileView.rb @@ -68,13 +68,13 @@ module PostRunner (max_hr = hr_zones.max_heart_rate) t.row([ 'Max. Heart Rate:', "#{max_hr} bpm" ]) end - if (date = user_profile.time_last_lthr_update) + if user_profile && (date = user_profile.time_last_lthr_update) t.row([ 'Last Lactate Threshold Update:', date ]) end - if (lthr = user_data.running_lactate_threshold_heart_rate) + if user_data && (lthr = user_data.running_lactate_threshold_heart_rate) t.row([ 'Running LT Heart Rate:', "#{lthr} bpm" ]) end - if (speed = user_profile.functional_threshold_speed) + if user_profile && (speed = user_profile.functional_threshold_speed) unit = { :metric => 'min/km', :statute => 'min/mile' }[@unit_system] t.row([ 'Running LT Pace:', "#{speedToPace(speed)} #{unit}" ]) end |