Solved a bug that caused some user's profile page to crash

This commit is contained in:
Tiago Ribeiro
2024-01-21 20:23:48 +00:00
parent c7f303e410
commit 52143d2472

View File

@@ -42,7 +42,9 @@ export default function CountrySelect({value, disabled = false, onChange}: Props
displayValue={(code: string) => { displayValue={(code: string) => {
const country = countries[code as unknown as keyof TCountries]; const country = countries[code as unknown as keyof TCountries];
return `${countryCodes.findOne("countryCode" as any, code).flag} ${country.name} (+${country.phone})`; return `${countryCodes.findOne("countryCode" as any, code)?.flag || ""} ${country?.name || "N/A"} (+${
country?.phone || "N/A"
})`;
}} }}
/> />
<Combobox.Button className="absolute inset-y-0 right-0 flex items-center pr-8"> <Combobox.Button className="absolute inset-y-0 right-0 flex items-center pr-8">