NR error: "Undefined method '[]' for nil:NilClass" in QueryBuilder#search_location
Closed this issue · 1 comments
yozlet commented
New Relic example. Frequency: 16 times from Jan 1 to Jan 7.
Stack trace:
NoMethodError: undefined method `[]' for nil:NilClass
/home/vcap/app/lib/data_magic/query_builder.rb: 132:in `search_location'
/home/vcap/app/lib/data_magic/query_builder.rb: 30:in `generate_squery'
/home/vcap/app/lib/data_magic/query_builder.rb: 13:in `from_params'
/home/vcap/app/lib/data_magic.rb: 69:in `search'
/home/vcap/app/app/controllers.rb: 53:in `block (2 levels) in <top (required)>'
(eval):225:in `block in call'
(eval):214:in `catch'
Refers to this line:
squery = squery.geo('location', distance: distance, lat: location[:lat], lng: location[:lon])