From e6afd0ac0a8423361dbecf01d403864f56f887c1 Mon Sep 17 00:00:00 2001 From: Stefan Hacker Date: Mon, 3 Sep 2012 20:32:26 +0200 Subject: [PATCH] Fix max_actions being nil when actions_open_per_week list is empty --- app/controllers/stats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 6e56b57c..97e368fa 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -179,7 +179,7 @@ class StatsController < ApplicationController @actions_open_per_week_array = convert_to_weeks_running_from_today_array(@actions_started, @max_weeks+1) @actions_open_per_week_array = cut_off_array(@actions_open_per_week_array, @count) - @max_actions = @actions_open_per_week_array.max + @max_actions = (@actions_open_per_week_array.max or 0) render :layout => false end