From b5e872a670e59841cab3b533ee66edb3ab74342d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 19 Nov 2019 10:46:54 +0100 Subject: [PATCH] Handle missing geolix database Close #313 Signed-off-by: Thomas Citharel --- lib/mobilizon_web/resolvers/config.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mobilizon_web/resolvers/config.ex b/lib/mobilizon_web/resolvers/config.ex index 3f13c968b..73f436f0c 100644 --- a/lib/mobilizon_web/resolvers/config.ex +++ b/lib/mobilizon_web/resolvers/config.ex @@ -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