Skip to content

Commit ef77035

Browse files
Merge pull request #758 from iamdharmesh/fix/fatal-error
Add a defensive check to prevent a fatal error during subscription renewal when Avatax is active.
2 parents 4ca1357 + 2bd0eec commit ef77035

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,9 @@ public function store_payment_response( $data ) {
589589
* @return array
590590
*/
591591
public function set_customer_taxable_address( $address ) {
592+
if ( ! WC()->customer ) {
593+
return $address;
594+
}
592595

593596
// set to the shipping address provided by Google Pay if:
594597
// 1. billing is not available

woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ public function clear_payment_data() {
703703
* @return array
704704
*/
705705
public function set_customer_taxable_address( $address ) {
706+
if ( ! WC()->customer ) {
707+
return $address;
708+
}
706709

707710
$billing_country = WC()->customer->get_billing_country();
708711

0 commit comments

Comments
 (0)