Setup Checklist: Fix exception in shipping. (https://github.com/woocommerce/woocommerce-admin/pull/4071)
This commit is contained in:
parent
94eec721c0
commit
28a43f18c1
|
@ -27,6 +27,11 @@ class ShippingRates extends Component {
|
|||
}
|
||||
|
||||
getShippingMethods( zone, type = null ) {
|
||||
// Sometimes the wc/v3/shipping/zones response does not include a methods attribute, return early if so.
|
||||
if ( ! zone || ! zone.methods || ! Array.isArray( zone.methods ) ) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if ( ! type ) {
|
||||
return zone.methods;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue