Check if package rates is an array before filtering on it (https://github.com/woocommerce/woocommerce-blocks/pull/9351)
Co-authored-by: Niels Lange <info@nielslange.de>
This commit is contained in:
parent
5457145c6a
commit
56879a4861
|
@ -460,6 +460,10 @@ class ShippingController {
|
|||
if ( count( $valid_packages ) !== count( $packages ) ) {
|
||||
$packages = array_map(
|
||||
function( $package ) {
|
||||
if ( ! is_array( $package['rates'] ) ) {
|
||||
$package['rates'] = [];
|
||||
return $package;
|
||||
}
|
||||
$package['rates'] = array_filter(
|
||||
$package['rates'],
|
||||
function( $rate ) {
|
||||
|
|
Loading…
Reference in New Issue