From 32b05487a1c849bae0d71b0fa6f1eaa4323ba5b7 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Tue, 12 Dec 2023 10:57:46 -0800 Subject: [PATCH] fix: Correctly navigate the user to the latest academic year when no data exists for the school --- app/controllers/home_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index ec44fdd6..2aed9856 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -52,6 +52,6 @@ class HomeController < ApplicationController end end - academic_year.range || AcademicYear.order("range DESC").first.range + academic_year&.range || AcademicYear.order("range DESC").first.range end end