Commit 883d138f15610a831ec8f5bf9d9ec640b6df140d

Authored by Valeriy Sizov
1 parent db469ea3

Fix 500 error when project is empty

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
lib/gitlab/markdown.rb
@@ -173,7 +173,7 @@ module Gitlab @@ -173,7 +173,7 @@ module Gitlab
173 end 173 end
174 174
175 def reference_commit(identifier) 175 def reference_commit(identifier)
176 - if commit = @project.commit(identifier) 176 + if @project.valid_repo? && commit = @project.commit(identifier)
177 link_to(identifier, project_commit_path(@project, commit), html_options.merge(title: CommitDecorator.new(commit).link_title, class: "gfm gfm-commit #{html_options[:class]}")) 177 link_to(identifier, project_commit_path(@project, commit), html_options.merge(title: CommitDecorator.new(commit).link_title, class: "gfm gfm-commit #{html_options[:class]}"))
178 end 178 end
179 end 179 end