Fix schedules index error 500 when schedules is null

Signed-off-by: Rafael Ravedutti <rrlmachado@inf.ufpr.br>
1 job for fix_schedules_index_check in 2 minutes and 12 seconds (queued for 8 seconds)
Status Job ID Name Coverage
  Test
failed #24684
ruby postgres
test

00:02:12

 
Name Stage Failure
failed
test Test
	from /cache/bundler/ruby/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:347:in `with_info_handler'
from /cache/bundler/ruby/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:319:in `run'
from /cache/bundler/ruby/2.5.0/gems/railties-5.0.7/lib/rails/test_unit/line_filtering.rb:9:in `run'
from /cache/bundler/ruby/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `block in __run'
from /cache/bundler/ruby/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `map'
from /cache/bundler/ruby/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `__run'
from /cache/bundler/ruby/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:136:in `run'
from /cache/bundler/ruby/2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
ERROR: Job failed: exit code 1