Fix 500 error when project is empty

This commit is contained in:
Valeriy Sizov 2012-10-17 23:59:42 +03:00
parent db469ea3e6
commit 883d138f15

View file

@ -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