From 83e3ff63457feb9f52ea0f7e67eefcd503f2ae2c Mon Sep 17 00:00:00 2001 From: pajri Date: Tue, 25 Apr 2023 14:47:22 +0700 Subject: [PATCH] fix bugs Card Policy --- .../client-portal/src/sections/dashboard/CardPolicy.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/client-portal/src/sections/dashboard/CardPolicy.tsx b/frontend/client-portal/src/sections/dashboard/CardPolicy.tsx index 2fa94b92..41ba3808 100644 --- a/frontend/client-portal/src/sections/dashboard/CardPolicy.tsx +++ b/frontend/client-portal/src/sections/dashboard/CardPolicy.tsx @@ -95,9 +95,10 @@ export default function CardPolicy(props: CardPolicyProps) { const [dialogTitle, setDialogTitle] = useState(''); const [isDialog, setIsDialog] = useState(''); - const { limit, topUpLimit } = props.data; - - console.log(limit); + const { limit, topUpLimit } = props.data || {}; + if (!limit || !topUpLimit) { + return null; + } const clickHandler = (isDialog: string) => { switch (isDialog) {