summaryrefslogtreecommitdiff
path: root/app/controllers/public
diff options
context:
space:
mode:
authorIzaak Alpert <ialpert@blackberry.com>2013-09-20 11:39:12 -0400
committerIzaak Alpert <ialpert@blackberry.com>2013-09-20 11:42:38 -0400
commit61a86101e81368b79bc9b99ef355518cde83facc (patch)
treec55aef9b78009e97f8bf3e108fb922cda9cdbf22 /app/controllers/public
parent05ef996e52eddececee3e0edb9c8bb5a0dc4c82d (diff)
downloadgitlab-ce-61a86101e81368b79bc9b99ef355518cde83facc.tar.gz
Prevent empty public projects from throwing exceptions
GITLAB-1279 (GITLAB-1264) Change-Id: Ifb5b4313bc91fae720f8ef5c36152c45e9d38934
Diffstat (limited to 'app/controllers/public')
-rw-r--r--app/controllers/public/projects_controller.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/controllers/public/projects_controller.rb b/app/controllers/public/projects_controller.rb
index 85216cd3271..3504bd3f1a5 100644
--- a/app/controllers/public/projects_controller.rb
+++ b/app/controllers/public/projects_controller.rb
@@ -1,7 +1,7 @@
class Public::ProjectsController < ApplicationController
skip_before_filter :authenticate_user!,
- :reject_blocked, :set_current_user_for_observers,
- :add_abilities
+ :reject_blocked, :set_current_user_for_observers,
+ :add_abilities
layout 'public'
@@ -16,9 +16,11 @@ class Public::ProjectsController < ApplicationController
render_404 and return unless @project
@repository = @project.repository
- @recent_tags = @repository.tags.first(10)
+ unless @project.empty_repo?
+ @recent_tags = @repository.tags.first(10)
- @commit = @repository.commit(params[:ref])
- @tree = Tree.new(@repository, @commit.id)
+ @commit = @repository.commit(params[:ref])
+ @tree = Tree.new(@repository, @commit.id)
+ end
end
end