diff --git a/app/models/landing_page/block/statistics.rb b/app/models/landing_page/block/statistics.rb index 425a5da2e0..4acdb10a60 100644 --- a/app/models/landing_page/block/statistics.rb +++ b/app/models/landing_page/block/statistics.rb @@ -13,7 +13,7 @@ def x_axis_keys def rows csv_headers[1..].map do |header| values = csv_rows.map do |row| - row[header].to_f + row[header].to_f if row[header].present? end { diff --git a/spec/models/landing_page/block/statistics_spec.rb b/spec/models/landing_page/block/statistics_spec.rb index 4ea9ec063f..ea74fabb01 100644 --- a/spec/models/landing_page/block/statistics_spec.rb +++ b/spec/models/landing_page/block/statistics_spec.rb @@ -89,8 +89,8 @@ 0.6, 0.7, 0.5, - 0.0, - 0.0, + nil, + nil, 0.5, 0.6, ],