Fixed an exception that was thrown when a country had no states when checking for package shippability

This commit is contained in:
Christopher Allford 2019-12-05 16:23:49 -08:00 committed by vedanshujain
parent 027257f624
commit a7daebc6fd
1 changed files with 2 additions and 2 deletions

View File

@ -293,8 +293,8 @@ class WC_Shipping {
return false;
}
$states = array_keys( WC()->countries->get_states( $country ) );
if ( is_array( $states ) && ! in_array( $package['destination']['state'], $states, true ) ) {
$states = WC()->countries->get_states( $country );
if ( is_array( $states ) && ! isset( $states[ $package['destination']['state'] ] ) ) {
return false;
}