From dfe19b2b84498af2eb0c7e401fda8f9eddfd0f46 Mon Sep 17 00:00:00 2001 From: Jason Hollingsworth Date: Fri, 1 Nov 2013 11:29:37 -0500 Subject: [PATCH] Fixes 500 error when user types in wrong group name. --- CHANGELOG | 1 + app/controllers/groups_controller.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index afa2450..6994c4c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ v 6.3.0 - Show branches list (which branches contains commit) on commit page (Andrew Kumanyaev) - Security improvements - Added support for GitLab CI 4.0 + - Fixed issue with 500 error when group did not exist v 6.2.0 - Public project pages are now visible to everyone (files, issues, wik, etc.) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index f80167d..bb46af1 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -102,7 +102,7 @@ class GroupsController < ApplicationController # Dont allow unauthorized access to group def authorize_read_group! - unless projects.present? or can?(current_user, :read_group, @group) + unless @group and (projects.present? or can?(current_user, :read_group, @group)) return render_404 end end -- libgit2 0.21.2