From a44e41c7afcfbd5f9fefa376586920597d1453c2 Mon Sep 17 00:00:00 2001 From: andregardi <33497086+andregardi@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:17:38 -0300 Subject: [PATCH] Check if tipaltiData is set before using it. (#95203) * Check if tipaltiData is set before using it. --- .../marketplace/checkout/request-client-payment.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/a8c-for-agencies/sections/marketplace/checkout/request-client-payment.tsx b/client/a8c-for-agencies/sections/marketplace/checkout/request-client-payment.tsx index 327902ca6dff5..43825d8c1b73f 100644 --- a/client/a8c-for-agencies/sections/marketplace/checkout/request-client-payment.tsx +++ b/client/a8c-for-agencies/sections/marketplace/checkout/request-client-payment.tsx @@ -74,7 +74,7 @@ function RequestClientPayment( { checkoutItems }: Props ) { const { data: tipaltiData } = useGetTipaltiPayee(); useEffect( () => { - if ( ! tipaltiData.IsPayable ) { + if ( tipaltiData && ! tipaltiData.IsPayable ) { setTipaltiActionRequiredVisible( true ); } }, [ tipaltiData ] ); @@ -165,7 +165,7 @@ function RequestClientPayment( { checkoutItems }: Props ) { onClick={ () => dispatch( recordTracksEvent( 'calypso_a4a_client_referral_form_email_click' ) ) } - disabled={ ! tipaltiData.IsPayable } + disabled={ ! tipaltiData?.IsPayable } />
dispatch( recordTracksEvent( 'calypso_a4a_client_referral_form_message_click' ) ) } - disabled={ ! tipaltiData.IsPayable } + disabled={ ! tipaltiData?.IsPayable } />