lib/parkwhiz/search.rb in parkwhiz-0.3.0 vs lib/parkwhiz/search.rb in parkwhiz-0.4.0
- old
+ new
@@ -16,8 +16,8 @@
request.params.merge!(search_parameters)
end
raise SearchError.new(response.body['error']) if response.body.kind_of?(Hash) && response.body['error']
- response.body['parking_listings'].collect{|parking_listing_json| Location.new(parking_listing_json)}
+ (response.body['parking_listings']||[]).collect{|parking_listing_json| Location.new(parking_listing_json)}
end
end
\ No newline at end of file