lib/inquisitio/facets.rb in inquisitio-2.1.0 vs lib/inquisitio/facets.rb in inquisitio-2.1.1
- old
+ new
@@ -1,10 +1,10 @@
module Inquisitio
class Facets
extend Forwardable
def initialize(facets)
- @facets = JSON.parse(facets.to_json, symbolize_names: true)
+ @facets = facets.nil? ? {} : JSON.parse(facets.to_json, symbolize_names: true)
end
def fields
@facets.keys
end
\ No newline at end of file