Commit 424b42d6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix 500 error on empty search in project

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4b65b0e0
...@@ -45,7 +45,7 @@ module Gitlab ...@@ -45,7 +45,7 @@ module Gitlab
private private
def blobs def blobs
if project.empty_repo? if project.empty_repo? || query.blank?
[] []
else else
project.repository.search_files(query, repository_ref) project.repository.search_files(query, repository_ref)
...@@ -53,7 +53,7 @@ module Gitlab ...@@ -53,7 +53,7 @@ module Gitlab
end end
def wiki_blobs def wiki_blobs
if project.wiki_enabled? if project.wiki_enabled? && query.present?
project_wiki = ProjectWiki.new(project) project_wiki = ProjectWiki.new(project)
unless project_wiki.empty? unless project_wiki.empty?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment