From c1c8f823a8cc5f001ba80a18c7d0677e55c27576 Mon Sep 17 00:00:00 2001 From: Chris Schlaeger Date: Sat, 21 Sep 2019 22:13:19 +0200 Subject: Fix: Don't crash if HR data contains holes. --- lib/postrunner/ActivitySummary.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/postrunner/ActivitySummary.rb b/lib/postrunner/ActivitySummary.rb index a5f14f6..48027c4 100644 --- a/lib/postrunner/ActivitySummary.rb +++ b/lib/postrunner/ActivitySummary.rb @@ -316,7 +316,7 @@ module PostRunner if zone.type == 18 total_time = 0.0 if zone.time_in_hr_zone - zone.time_in_hr_zone.each { |tiz| total_time += tiz } + zone.time_in_hr_zone.each { |tiz| total_time += tiz if tiz } end break if total_time <= 0.0 if zone.heart_rate_zones -- cgit v1.2.3