From 52143d2472fcb5545a1c4d6d1ee50fa2270712c5 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Sun, 21 Jan 2024 20:23:48 +0000 Subject: [PATCH] Solved a bug that caused some user's profile page to crash --- src/components/Low/CountrySelect.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Low/CountrySelect.tsx b/src/components/Low/CountrySelect.tsx index 838395da..b9a5a110 100644 --- a/src/components/Low/CountrySelect.tsx +++ b/src/components/Low/CountrySelect.tsx @@ -42,7 +42,9 @@ export default function CountrySelect({value, disabled = false, onChange}: Props displayValue={(code: string) => { 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" + })`; }} />