Check for product categories before loading value (https://github.com/woocommerce/woocommerce-admin/pull/1164)

* Check for product categories before loading value

* Filter product category list for undefined values

* Remove unnecessary double check of productCategories
This commit is contained in:
Joshua T Flowers 2018-12-25 18:28:37 +08:00 committed by GitHub
parent f51dba44a0
commit f88311b372
1 changed files with 3 additions and 1 deletions

View File

@ -118,7 +118,9 @@ class ProductsReportTable extends Component {
products: product_id,
} );
const categories = this.props.categories;
const productCategories = category_ids.map( category_id => categories[ category_id ] );
const productCategories = category_ids
.map( category_id => categories[ category_id ] )
.filter( Boolean );
return [
{