current_user判空

This commit is contained in:
lizanle 2015-04-15 10:30:56 +08:00
parent a0f01469a0
commit a7f1026828
1 changed files with 1 additions and 1 deletions

View File

@ -345,7 +345,7 @@ class CoursesService
def course_dynamic(params,current_user) def course_dynamic(params,current_user)
@user = User.find(params[:id]) @user = User.find(params[:id])
if !current_user.admin? && !@user.active? if current_user.nil? && !current_user.admin? && !@user.active?
raise '404' raise '404'
return return
end end