Skip to content
Snippets Groups Projects
Commit 1c14a3e7 authored by Alex Reisner's avatar Alex Reisner
Browse files

Never fetch XML if search query is blank.

We were checking for a blank query in fetch_coordinates, now we do it in
_fetch_xml.
parent 9ecbb0c7
No related branches found
No related tags found
No related merge requests found
...@@ -323,7 +323,6 @@ module Geocoder ...@@ -323,7 +323,6 @@ module Geocoder
# Returns array [lat,lon] if found, nil if not found or if network error. # Returns array [lat,lon] if found, nil if not found or if network error.
# #
def self.fetch_coordinates(query) def self.fetch_coordinates(query)
return nil if query.blank?
return nil unless doc = self.search(query) return nil unless doc = self.search(query)
# make sure search found a result # make sure search found a result
...@@ -342,6 +341,7 @@ module Geocoder ...@@ -342,6 +341,7 @@ module Geocoder
# This method is not intended for general use (prefer Geocoder.search). # This method is not intended for general use (prefer Geocoder.search).
# #
def self._fetch_xml(query) def self._fetch_xml(query)
return nil if query.blank?
params = { params = {
:address => query, :address => query,
:sensor => "false" :sensor => "false"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment