diff --git a/src/library/FOSSBilling/GeoIP/Country.php b/src/library/FOSSBilling/GeoIP/Country.php index 6d379de4f..fc1739951 100644 --- a/src/library/FOSSBilling/GeoIP/Country.php +++ b/src/library/FOSSBilling/GeoIP/Country.php @@ -40,8 +40,8 @@ class Country implements \JsonSerializable // Instance the language $country = CountryAlpha2::from($countyRecord['iso_code']); - $this->name = $country->getNameInLanguage($language); - $this->flag = $country->getFlagEmoji(); + $this->name = $country->getNameInLanguage($language) ?? 'Unknown'; + $this->flag = $country->getFlagEmoji() ?? ''; foreach ($country->getCurrenciesAlpha3() as $currency) { $currencies[] = $currency->value; diff --git a/src/library/FOSSBilling/GeoIP/Reader.php b/src/library/FOSSBilling/GeoIP/Reader.php index 746cb3e85..b437f90b3 100644 --- a/src/library/FOSSBilling/GeoIP/Reader.php +++ b/src/library/FOSSBilling/GeoIP/Reader.php @@ -55,7 +55,7 @@ class Reader */ public function get(string $ipAddress) { - return $this->reader->get($ipAddress); + return $this->reader->get($ipAddress) ?? []; } /**