From 883d138f15610a831ec8f5bf9d9ec640b6df140d Mon Sep 17 00:00:00 2001 From: Valeriy Sizov Date: Wed, 17 Oct 2012 23:59:42 +0300 Subject: [PATCH] Fix 500 error when project is empty --- lib/gitlab/markdown.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index ba993abf..fab89d09 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -173,7 +173,7 @@ module Gitlab end def reference_commit(identifier) - if commit = @project.commit(identifier) + if @project.valid_repo? && commit = @project.commit(identifier) link_to(identifier, project_commit_path(@project, commit), html_options.merge(title: CommitDecorator.new(commit).link_title, class: "gfm gfm-commit #{html_options[:class]}")) end end