Skip to content

Commit

Permalink
Check if tipaltiData is set before using it. (#95203)
Browse files Browse the repository at this point in the history
* Check if tipaltiData is set before using it.
  • Loading branch information
andregardi authored Oct 7, 2024
1 parent f5856b7 commit a44e41c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function RequestClientPayment( { checkoutItems }: Props ) {
const { data: tipaltiData } = useGetTipaltiPayee();

useEffect( () => {
if ( ! tipaltiData.IsPayable ) {
if ( tipaltiData && ! tipaltiData.IsPayable ) {
setTipaltiActionRequiredVisible( true );
}
}, [ tipaltiData ] );
Expand Down Expand Up @@ -165,7 +165,7 @@ function RequestClientPayment( { checkoutItems }: Props ) {
onClick={ () =>
dispatch( recordTracksEvent( 'calypso_a4a_client_referral_form_email_click' ) )
}
disabled={ ! tipaltiData.IsPayable }
disabled={ ! tipaltiData?.IsPayable }
/>
<div
className={ clsx( 'checkout__client-referral-form-footer-error', {
Expand All @@ -187,7 +187,7 @@ function RequestClientPayment( { checkoutItems }: Props ) {
onClick={ () =>
dispatch( recordTracksEvent( 'calypso_a4a_client_referral_form_message_click' ) )
}
disabled={ ! tipaltiData.IsPayable }
disabled={ ! tipaltiData?.IsPayable }
/>
</FormFieldset>
</div>
Expand Down

0 comments on commit a44e41c

Please sign in to comment.