Skip to content

Commit

Permalink
Taxonomies: Fix error when a taxonomy has no attached post type (#9744)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Sep 11, 2018
1 parent 7e479a0 commit 8129584
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* External dependencies
*/
import { some } from 'lodash';

/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -63,7 +68,7 @@ export default compose(
const tags = tagsTaxonomy && select( 'core/editor' ).getEditedPostAttribute( tagsTaxonomy.rest_base );
return {
areTagsFetched: tagsTaxonomy !== undefined,
isPostTypeSupported: tagsTaxonomy && tagsTaxonomy.types.some( ( type ) => type === postType ),
isPostTypeSupported: tagsTaxonomy && some( tagsTaxonomy.types, ( type ) => type === postType ),
hasTags: tags && tags.length,
};
} ),
Expand Down

0 comments on commit 8129584

Please sign in to comment.