diff --git a/ui/v2.5/src/utils/country.ts b/ui/v2.5/src/utils/country.ts index 20555abb8..d9961a388 100644 --- a/ui/v2.5/src/utils/country.ts +++ b/ui/v2.5/src/utils/country.ts @@ -20,8 +20,10 @@ const fuzzyDict: Record = { const getISOCountry = (country: string | null | undefined) => { if (!country) return null; - const code = fuzzyDict[country] ?? Countries.getAlpha2Code(country, "en"); - if (!code) return null; + const code = + fuzzyDict[country] ?? Countries.getAlpha2Code(country, "en") ?? country; + // Check if code is valid alpha2 iso + if (!Countries.alpha2ToAlpha3(code)) return null; return { code,