Fixed nil error on schedule page

This commit is contained in:
Godwin 2016-08-30 08:09:20 -07:00 committed by GitHub
parent 29d62ad53b
commit 8733300b81

View File

@ -572,7 +572,10 @@ class ApplicationController < LinguaFrancaApplicationController
@schedule.each do | day, data | @schedule.each do | day, data |
@schedule[day][:times] = data[:times].sort.to_h @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 if do_analyze
data[:times].each do | time, time_data | data[:times].each do | time, time_data |