Fix error when saved value is not a valid country code

This commit is contained in:
Kijin Sung 2024-04-15 01:20:05 +09:00
parent c26e242fdf
commit c1278f2615

View file

@ -260,9 +260,16 @@ class Value
case 'kr_zip':
return is_array($value) ? implode(' ', $value) : $value;
case 'country':
$country = i18n::listCountries()[$value];
$lang_type = \Context::getLangType();
return $lang_type === 'ko' ? $country->name_korean : $country->name_english;
$country = i18n::listCountries()[$value] ?? '';
if ($country)
{
$lang_type = \Context::getLangType();
return $lang_type === 'ko' ? $country->name_korean : $country->name_english;
}
else
{
return '';
}
case 'language':
return Lang::getSupportedList()[$value]['name'] ?? '';
case 'date':