From 3829f21da191c68f29e0798fce5b7031268f8635 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Wed, 23 Sep 2020 16:58:22 +0800 Subject: [PATCH] FIX load project bug --- app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cd317e50f..bcf42ccbc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,7 +10,7 @@ class ApplicationController < ActionController::Base include LoggerHelper include LoginHelper include RegisterHelper - + protect_from_forgery prepend: true, unless: -> { request.format.json? } before_action :check_sign @@ -749,7 +749,7 @@ class ApplicationController < ActionController::Base if @project and current_user.can_read_project?(@project) logger.info "###########: has project and can read project" @project - elsif current_user.is_a?(AnonymousUser) + elsif @project && current_user.is_a?(AnonymousUser) logger.info "###########:This is AnonymousUser" @project = nil if !@project.is_public? render_forbidden and return