From 8733300b81667713b7781be8207e99635d7f05ca Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 30 Aug 2016 08:09:20 -0700 Subject: [PATCH] Fixed nil error on schedule page --- app/controllers/application_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4e1e241..e3c50f6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -572,7 +572,10 @@ class ApplicationController < LinguaFrancaApplicationController @schedule.each do | day, data | @schedule[day][:times] = data[:times].sort.to_h - @schedule[day][:locations][0] = :add if do_analyze || @schedule[day][:locations].empty? + if do_analyze || @schedule[day][:locations].empty? + @schedule[day][:locations] ||= [] + @schedule[day][:locations][0] = :add + end if do_analyze data[:times].each do | time, time_data |