From 2d7d4075d2cd08c31f13aee5651885d2af496b96 Mon Sep 17 00:00:00 2001 From: Andres Alvidrez Date: Fri, 6 Sep 2024 10:08:38 -0600 Subject: [PATCH] Fix session show when navigating as guest --- app/controllers/sessions_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 3f6154aa..485a0395 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -10,7 +10,7 @@ def index end def show - @user_session_ids = current_user.sessions.pluck(:id) + @user_session_ids = current_user&.sessions&.pluck(:id) || [] @session = if user_signed_in? sessions.friendly.includes(:location, :tags, speakers: [profile: :image_attachment]).find(params[:id]) else