From f19f1b6d86e31392147bf2e96197cfcb771ee34d Mon Sep 17 00:00:00 2001 From: Chris Schlaeger Date: Sat, 21 Sep 2019 14:11:51 +0200 Subject: Not all FIT files have a user_profile section. --- lib/postrunner/UserProfileView.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3