Unverified Commit 6b7e80cb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Prevent 500 error when search wiki for non-existing repo


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 638331d0
......@@ -24,6 +24,7 @@ v 7.3.0
- Comment & Close button
- Process git push --all much faster
- Don't allow edit of system notes
- Project wiki search (Ralf Seidler)
v 7.2.1
- Delete orphaned labels during label migration (James Brooks)
......
......@@ -49,11 +49,16 @@ def blobs
end
def wiki_blobs
if !project.wiki_enabled?
[]
if project.wiki_enabled?
wiki_repo = Repository.new(ProjectWiki.new(project).path_with_namespace)
if wiki_repo.exists?
wiki_repo.search_files(query)
else
[]
end
else
Repository.new(ProjectWiki.new(project).path_with_namespace).
search_files(query)
[]
end
end
......
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