the object does not support the operation or argument

If the customer closes Apple payment sheet before validation is complete, the error appears. It's not a big deal, but we are improving our performance, so I need to fix this annoying log:

My code to validate merchant works and is this (I'm using braintree with apple pay):

// Validate merchant
session.onvalidatemerchant = async event => {

  // Do request
  const response = await getApplePay()
  console.log(response)

  if (response.success) {

    instance.performValidation({
      validationURL: event.validationURL,
      displayName: 'Bucked Up'
    }, (err, merchantSession) => {

      if (err) {

        setLoadingApple(false)
        session.abort()
        return

      } else if(merchantSession) {

        session.completeMerchantValidation(response.data)
        setLoadingApple(false)

      }

    })

  } else {

    setLoadingApple(false)
    session.abort()

  }

}
the object does not support the operation or argument
 
 
Q