From 784958dafa7191f5515a902ba61b592c6b18ca62 Mon Sep 17 00:00:00 2001 From: sirineJ <112706079+sirineJ@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:31:16 +0200 Subject: [PATCH] fix: Intl RangeError exception --- .../components/PhoneNumberInput/PhoneNumberInputService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts b/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts index e78b011571..d2aa1e4e24 100644 --- a/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts +++ b/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts @@ -46,7 +46,7 @@ export function mapCountryCodeOptions( const displayName = new Intl.DisplayNames(locale, { type: 'region' }); return countryCodeOptions .map(({ code, country }) => { - const countryName = displayName.of(country); + const countryName = country ? displayName.of(country) : country; return { label: countryName ? `${countryName} (${code})` : code, value: code,