Fixed error if no geo location backend is selected.
This commit is contained in:
parent
b0af4f85ee
commit
92c0cb9da8
6 changed files with 14 additions and 10 deletions
|
@ -23,7 +23,10 @@ store device for user
|
||||||
|
|
||||||
# get location info
|
# get location info
|
||||||
location_details = Service::GeoIp.location(ip)
|
location_details = Service::GeoIp.location(ip)
|
||||||
|
location = 'unknown'
|
||||||
|
if location_details
|
||||||
location = location_details['country_name']
|
location = location_details['country_name']
|
||||||
|
end
|
||||||
|
|
||||||
# find device by fingerprint
|
# find device by fingerprint
|
||||||
if fingerprint
|
if fingerprint
|
||||||
|
|
|
@ -20,6 +20,7 @@ returns
|
||||||
def load_adapter_by_setting(setting)
|
def load_adapter_by_setting(setting)
|
||||||
adapter = Setting.get(setting)
|
adapter = Setting.get(setting)
|
||||||
return if !adapter
|
return if !adapter
|
||||||
|
return if adapter.empty?
|
||||||
|
|
||||||
# load backend
|
# load backend
|
||||||
load_adapter(adapter)
|
load_adapter(adapter)
|
||||||
|
|
Loading…
Reference in a new issue