Skip to content
Snippets Groups Projects
Verified Commit 6b7e80cb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Prevent 500 error when search wiki for non-existing repo

parent 638331d0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -49,11 +49,16 @@ module Gitlab
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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment