Slight geoip reader fixes (#2559)

Small changes to avoid error generation
This commit is contained in:
Belle Aerni authored and GitHub committed 2024-12-27 02:59:29 -08:00
1 parent cc1cd7b467
commit b41ddec682
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -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;
+1 -1
View File
@@ -55,7 +55,7 @@ class Reader
*/
public function get(string $ipAddress)
{
return $this->reader->get($ipAddress);
return $this->reader->get($ipAddress) ?? [];
}
/**