From ca7d3c27813007d1e7c9c9c919c082424584acae Mon Sep 17 00:00:00 2001 From: abhip2565 Date: Mon, 14 Apr 2025 14:05:24 +0530 Subject: [PATCH] [INJIMOB-3196] ad null checks to fix crash issues (#1887) Signed-off-by: Abhishek Paul --- components/VC/Views/VCCardView.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/VC/Views/VCCardView.tsx b/components/VC/Views/VCCardView.tsx index 9e2b0ab5..b6597a7f 100644 --- a/components/VC/Views/VCCardView.tsx +++ b/components/VC/Views/VCCardView.tsx @@ -63,10 +63,11 @@ export const VCCardView: React.FC = ({ }, [isDownloading, controller.credential]); useEffect(() => { + if (!verifiableCredentialData || !verifiableCredentialData.vcMetadata) return; const { issuer, credentialConfigurationId, - vcMetadata: {format}, + vcMetadata: { format }, } = verifiableCredentialData; if (vcMetadata.issuerHost) { getCredentialIssuersWellKnownConfig( @@ -87,12 +88,12 @@ export const VCCardView: React.FC = ({ ); }); } - }, [verifiableCredentialData?.vcMetadata]); + }, [verifiableCredentialData]); - if (!isVCLoaded(controller.credential, fields)) { + if (!isVCLoaded(controller.credential, fields) || !wellknown || !vc) { return ; } - + const CardViewContent = () => (