diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index cf98690f..21ee8562 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -438,7 +438,7 @@ module Precious end get '/search' do - @query = params[:q] + @query = params[:q] || '' wiki = wiki_new # Sort wiki search results by count (desc) and then by name (asc) @results = wiki.search(@query).sort { |a, b| (a[:count] <=> b[:count]).nonzero? || b[:name] <=> a[:name] }.reverse