From f9e5c05046ea31e1ff02971e8ea9f28e514f842f Mon Sep 17 00:00:00 2001 From: GROUX Richard Date: Tue, 21 Jul 2015 19:35:45 +0200 Subject: [PATCH] Fix search without querry App crash when we try to get /search Add an empty querry '' as default --- lib/gollum/app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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