Commit 5b091c764c6e04df1091eb333fc34a44226b5869

Authored by Dmitriy Zaporozhets
2 parents 0f665f41 dfe19b2b

Merge pull request #5512 from jhollingsworth/feature/missing-group-500-fix

Fixes 500 error when user types in wrong group name.
@@ -6,6 +6,7 @@ v 6.3.0 @@ -6,6 +6,7 @@ v 6.3.0
6 - Show branches list (which branches contains commit) on commit page (Andrew Kumanyaev) 6 - Show branches list (which branches contains commit) on commit page (Andrew Kumanyaev)
7 - Security improvements 7 - Security improvements
8 - Added support for GitLab CI 4.0 8 - Added support for GitLab CI 4.0
  9 + - Fixed issue with 500 error when group did not exist
9 10
10 v 6.2.0 11 v 6.2.0
11 - Public project pages are now visible to everyone (files, issues, wik, etc.) 12 - Public project pages are now visible to everyone (files, issues, wik, etc.)
app/controllers/groups_controller.rb
@@ -102,7 +102,7 @@ class GroupsController < ApplicationController @@ -102,7 +102,7 @@ class GroupsController < ApplicationController
102 102
103 # Dont allow unauthorized access to group 103 # Dont allow unauthorized access to group
104 def authorize_read_group! 104 def authorize_read_group!
105 - unless projects.present? or can?(current_user, :read_group, @group) 105 + unless @group and (projects.present? or can?(current_user, :read_group, @group))
106 return render_404 106 return render_404
107 end 107 end
108 end 108 end