Store details: check if industries exist before trimming (https://github.com/woocommerce/woocommerce-admin/pull/4120)

This commit is contained in:
Paul Sealock 2020-04-15 06:46:41 +12:00 committed by GitHub
parent 61f650a2a2
commit 67b417af03
1 changed files with 5 additions and 1 deletions

View File

@ -131,7 +131,11 @@ class StoreDetails extends Component {
*
* This comment may be removed when a refactor to wp.data datatores is complete.
*/
if ( region !== 'US' ) {
if (
region !== 'US' &&
profileItems.industry &&
profileItems.industry.length
) {
const cbdSlug = 'cbd-other-hemp-derived-products';
const trimmedIndustries = profileItems.industry.filter(
( industry ) => {