Handle case where no locations are sent in update request.

This commit is contained in:
Jeff Stieler 2016-06-15 16:22:57 -06:00 committed by Justin Shreve
parent e5fac4911e
commit 6d891e1247
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ class WC_REST_Shipping_Zone_Locations_Controller extends WC_REST_Shipping_Zones_
$raw_locations = $request->get_json_params();
$locations = array();
foreach ( $raw_locations as $raw_location ) {
foreach ( (array) $raw_locations as $raw_location ) {
if ( empty( $raw_location['code'] ) || empty( $raw_location['type'] ) ) {
continue;
}