Skip to content

Commit

Permalink
fix nil reference (#76)
Browse files Browse the repository at this point in the history
If `country['timeline']['cases'].values.reject!(&:zero?) doesn't reject anything, the result will be nil.
  • Loading branch information
joshleblanc committed Mar 29, 2020
1 parent f1a0ea6 commit 3a8f844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kovid/tablelize.rb
Expand Up @@ -230,7 +230,7 @@ def histogram(country, date_string)
end

# From dates where number of !cases.zero?
positive_cases_figures = country['timeline']['cases'].values.reject!(&:zero?)
positive_cases_figures = country['timeline']['cases'].values.reject(&:zero?)
dates = country['timeline']['cases'].reject { |_k, v| v.zero? }.keys
data = []

Expand Down

0 comments on commit 3a8f844

Please sign in to comment.