Commit ca42e91e6128d56df23faeeabebad02e16ca734f

Authored by Dmitriy Zaporozhets
2 parents db469ea3 883d138f

Merge pull request #1727 from gitlabhq/fix_bug_wiki

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