Handle missing geolix database
Close #313 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
792a2deddb
commit
258550ec94
@ -15,13 +15,13 @@ defmodule MobilizonWeb.Resolvers.Config do
|
||||
geolix = Geolix.lookup(ip)
|
||||
|
||||
country_code =
|
||||
case geolix.city do
|
||||
case Map.get(geolix, :city) do
|
||||
%{country: %Country{iso_code: country_code}} -> String.downcase(country_code)
|
||||
_ -> nil
|
||||
end
|
||||
|
||||
location =
|
||||
case geolix.city do
|
||||
case Map.get(geolix, :city) do
|
||||
%{location: %Location{} = location} -> Map.from_struct(location)
|
||||
_ -> nil
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user