diff --git a/includes/class-wc-tax.php b/includes/class-wc-tax.php index 58a63dfbe2d..348f0af3ea6 100644 --- a/includes/class-wc-tax.php +++ b/includes/class-wc-tax.php @@ -239,9 +239,11 @@ class WC_Tax { $rates = self::find_rates( $args ); $shipping_rates = array(); - foreach ( $rates as $key => $rate ) { - if ( 'yes' === $rate['shipping'] ) { - $shipping_rates[ $key ] = $rate; + if ( is_array( $rates ) ) { + foreach ( $rates as $key => $rate ) { + if ( 'yes' === $rate['shipping'] ) { + $shipping_rates[ $key ] = $rate; + } } }