Skip to content

Commit

Permalink
Trap error here
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Feb 27, 2016
1 parent c0760c7 commit 8bb28ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/generic_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def index

@bucketed_metrics = @metrics.group_by { |g| g.datetime.strftime "%Y-%m-%d" }

@with_year = @metrics.first.datetime.year < Time.now.year
@with_year = begin
@metrics.first.datetime.year < Time.now.year
rescue NoMethodError
nil
end

@has_charts = false
end
Expand Down

0 comments on commit 8bb28ac

Please sign in to comment.