Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Check for null session before going forward (#8537)
Browse files Browse the repository at this point in the history
  • Loading branch information
senadir authored and gigitux committed Feb 27, 2023
1 parent 5e4464c commit 2d7a750
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Shipping/ShippingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ public function flush_cache( $settings ) {
* @return array
*/
public function filter_taxable_address( $address ) {

if ( null === WC()->session ) {
return $address;
}
// We only need to select from the first package, since pickup_location only supports a single package.
$chosen_method = current( WC()->session->get( 'chosen_shipping_methods', array() ) ) ?? '';
$chosen_method_id = explode( ':', $chosen_method )[0];
Expand Down

0 comments on commit 2d7a750

Please sign in to comment.