From c781c10fe918c1b86974541cccc6e9b04aad5db6 Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Thu, 11 Jan 2024 14:18:57 +0000 Subject: [PATCH] Prevented an error that should only happen if the user had the type changed directly on the DB for testing purposes --- src/pages/payment-record.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/payment-record.tsx b/src/pages/payment-record.tsx index 0aacddcb..4090787a 100644 --- a/src/pages/payment-record.tsx +++ b/src/pages/payment-record.tsx @@ -811,14 +811,14 @@ export default function PaymentRecord() { options={(users.filter((u) => u.type === "corporate") as CorporateUser[]).map((user) => ({ value: user.id, meta: user, - label: `${user.corporateInformation.companyInformation.name || user.name} - ${user.email}`, + label: `${user.corporateInformation?.companyInformation?.name || user.name} - ${user.email}`, }))} defaultValue={ user.type === "corporate" ? { value: user.id, meta: user, - label: `${user.corporateInformation.companyInformation.name || user.name} - ${user.email}`, + label: `${user.corporateInformation?.companyInformation?.name || user.name} - ${user.email}`, } : undefined }