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
|
||||
location_details = Service::GeoIp.location(ip)
|
||||
location = 'unknown'
|
||||
if location_details
|
||||
location = location_details['country_name']
|
||||
end
|
||||
|
||||
# find device by fingerprint
|
||||
if fingerprint
|
||||
|
|
|
@ -20,6 +20,7 @@ returns
|
|||
def load_adapter_by_setting(setting)
|
||||
adapter = Setting.get(setting)
|
||||
return if !adapter
|
||||
return if adapter.empty?
|
||||
|
||||
# load backend
|
||||
load_adapter(adapter)
|
||||
|
|
Loading…
Reference in a new issue