When searching blobs in a project: undefined method `encoding' for nil:NilClass
Local search URL:
Summary
Search returns a 500 NoMethodError
Steps to reproduce
Make a search like http://localhost:3000/search?utf8=%E2%9C%93&snippets=&scope=blobs&search=foo&project_id=1
Some terms seem to work (e.g., 'bar' works locally, returning results), while others fail. I'm not sure on the difference yet.
What is the current bug behavior?
What is the expected correct behavior?
Search results
Relevant logs and/or screenshots
NoMethodError - undefined method `encoding' for nil:NilClass:
rouge (2.2.0) lib/rouge/lexer.rb:247:in `assert_utf8!'
rouge (2.2.0) lib/rouge/lexer.rb:387:in `lex'
rouge (2.2.0) lib/rouge/formatter.rb:59:in `token_lines'
lib/rouge/formatters/html_gitlab.rb:16:in `stream'
rouge (2.2.0) lib/rouge/formatter.rb:37:in `format'
rouge (2.2.0) lib/rouge/formatter.rb:25:in `format'
lib/gitlab/highlight.rb:50:in `highlight_plain'
lib/gitlab/highlight.rb:56:in `rescue in highlight_rich'
lib/gitlab/highlight.rb:54:in `highlight_rich'
lib/gitlab/highlight.rb:45:in `highlight_text'
lib/gitlab/highlight.rb:18:in `highlight'
lib/gitlab/highlight.rb:5:in `highlight'
app/helpers/blob_helper.rb:3:in `highlight'
app/views/shared/_file_highlight.html.haml:16:in `_app_views_shared__file_highlight_html_haml___2268168918962266686_47203943893780'