500 Error when searching through repo without any code
Created by: demisx
I have created one project for the purpose of storing some wiki pages, thus this project doesn't have any code files. Using search in the header generates the following 500 error in Gitlab 6.7.5 on Ubuntu 12.04:
Started GET "/search?utf8=%E2%9C%93&search=docs&group_id=&project_id=32&search_code=true&repository_ref=" for 127.0.0.1 at 2014-04-14 15:18:01 -0700
Processing by SearchController#show as HTML
Parameters: {"utf8"=>"✓", "search"=>"docs", "group_id"=>"", "project_id"=>"32", "search_code"=>"true", "repository_ref"=>""}
Started GET "/search/autocomplete?project_id=32&project_ref=&term=docs" for 127.0.0.1 at 2014-04-14 15:18:01 -0700
Processing by SearchController#autocomplete as JSON
Parameters: {"project_id"=>"32", "project_ref"=>"", "term"=>"docs"}
Completed 500 Internal Server Error in 409ms
NoMethodError (undefined method `[]' for nil:NilClass):
app/services/search/project_service.rb:16:in `execute'
app/controllers/search_controller.rb:11:in `show'
app/controllers/application_controller.rb:58:in `set_current_user_for_thread'
Completed 200 OK in 782ms (Views: 0.2ms | ActiveRecord: 234.6ms)