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

Merge pull request #168 from galvinhsiu/master

In lookups/base, invalid JSON needs to be rescued for ActiveSupport::JSON
parents 170a934a b8b51246
No related branches found
No related tags found
No related merge requests found
......@@ -120,14 +120,14 @@ module Geocoder
# Parses a raw search result (returns hash or array).
#
def parse_raw_data(raw_data)
if defined?(ActiveSupport::JSON)
ActiveSupport::JSON.decode(raw_data)
else
begin
begin
if defined?(ActiveSupport::JSON)
ActiveSupport::JSON.decode(raw_data)
else
JSON.parse(raw_data)
rescue
warn "Geocoding API's response was not valid JSON."
end
rescue
warn "Geocoding API's response was not valid JSON."
end
end
......
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