Title: Error getAddress() on null
Last modified: April 29, 2026

---

# Error getAddress() on null

 *  Resolved [Karlo](https://wordpress.org/support/users/karlob/)
 * (@karlob)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/error-getaddress-on-null/)
 * Hi Payment Plugins team,
   we’re seeing an intermittent fatal error during Apple
   Pay / express checkout updates:
 * <code class=””>Critical Uncaught Error: Call to a member function getAddress()
   on null
   in `src/AjaxFrontendHandler.php` (around line 84), inside <code class
   =””>AjaxFrontendHandler::get_update_data().
 * From debugging, the issue is that code in the shipping branch assumes <code class
   =””>PurchaseUnit::getShipping() is always present and calls <code class=””>->
   getAddress() / <code class=””>->getSelectedOption() directly. In some valid PayPal
   order states (early/update calls), `purchase_unit.shipping` is not set yet, so
   this becomes null and crashes.
 * Could you add a null guard before using shipping (e.g. <code class=””>$shipping
   = $purchase_unit->getShipping(); if ( $shipping ) { … }) so missing shipping 
   blocks are handled safely?
 * Environment/context:
    - WooCommerce + CheckoutWC
    - Payment method: `ppcp_applepay`
    - Hook path includes `woocommerce_checkout_update_order_review`
    - Plugin version: 2.0.14
 * Thanks!
    -  This topic was modified 1 month, 1 week ago by [Karlo](https://wordpress.org/support/users/karlob/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/error-getaddress-on-null/#post-18894765)
 * Hi [@karlob](https://wordpress.org/support/users/karlob/)
 * Thank you for contacting Payment Plugins. We will review this error and respond
   with feedback. Do you know if the customer attempted to use PayPal originally
   and then switched to Apple Pay?
 * Kind Regards
 *  Thread Starter [Karlo](https://wordpress.org/support/users/karlob/)
 * (@karlob)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/error-getaddress-on-null/#post-18894954)
 * Hi,
 * I don’t have confirmation whether the customer first attempted PayPal and then
   switched to Apple Pay, but based on the message it seems they went directly with
   Apple Pay.
 * What I do know:
    - The issue occurred on the **single product page** using the Apple Pay button.
    - The error did **not** occur when the customer added the product to the cart
      and used express checkout from there.
    - The payment was successfully completed via Apple Pay from the **cart page**.
 * Thanks!
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/error-getaddress-on-null/#post-18895818)
 * Hi [@karlob](https://wordpress.org/support/users/karlob/)
 * In the next release, we’re going to be deprecating the AjaxFrontendHandler class
   where that error occurred because it’s no longer needed.
 * Kind Regards
 *  Thread Starter [Karlo](https://wordpress.org/support/users/karlob/)
 * (@karlob)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/error-getaddress-on-null/#post-18896498)
 * Hi Clayton,
   We encountered the same issue when trying to process refunds via 
   the WooCommerce mobile app. Do you have any information on when the patched version
   will be released, or if there’s a quick fix we can use in the meantime?
 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/error-getaddress-on-null/#post-18896543)
 * Hi [@karlob](https://wordpress.org/support/users/karlob/)
 * > We encountered the same issue when trying to process refunds via the WooCommerce
   > mobile app.
 * Can you share the error log? The AjaxFrontendHandler is not involved in the refund
   process so I’d like to review the error log.
 * That code has been in place since nearly the first release of this plugin several
   years ago so it’s odd that errors would just now start triggering for you.
 * You can reach out via the support widget via the WordPress Admin > WooCommerce
   > PayPal > Support page and we can share the next release.
 * Kind Regards

Viewing 5 replies - 1 through 5 (of 5 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-getaddress-on-null%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/pymntpl-paypal-woocommerce/assets/icon-256x256.png?rev=2718338)
 * [Payment Plugins for PayPal WooCommerce](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/reviews/)

## Tags

 * [apple pay](https://wordpress.org/support/topic-tag/apple-pay/)

 * 7 replies
 * 2 participants
 * Last reply from: [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * Last activity: [1 month, 1 week ago](https://wordpress.org/support/topic/error-getaddress-on-null/#post-18896543)
 * Status: resolved