From 48a5c2ce90cb1d68b1c871ee4b1d33a2fd1e0be5 Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 23 Aug 2016 06:38:52 -0700 Subject: [PATCH] Fixed error on stats page due to nil food option --- app/controllers/conferences_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 2ecaa28..afe9f41 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -438,8 +438,10 @@ class ConferencesController < ApplicationController @bikes += 1 if r.bike == 'yes' - @food[r.food.to_sym] += 1 - @food[:all] += 1 + if r.food.present? + @food[r.food.to_sym] += 1 + @food[:all] += 1 + end if r.registration_fees_paid.present? && r.registration_fees_paid > 0 @donation_count += 1