Skip to content

Commit

Permalink
Prevent crash if tags werent fetched yet
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Aug 1, 2018
1 parent e927c9a commit b5fdf53
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default compose( [
withSelect( ( select ) => {
const postType = select( 'core/editor' ).getCurrentPostType();
const tags = select( 'core' ).getTaxonomy( 'post_tag' );
const terms = select( 'core/editor' ).getEditedPostAttribute( tags.rest_base );
const terms = tags ? select( 'core/editor' ).getEditedPostAttribute( tags.rest_base ) : [];
return {
hasTags: tags && terms && terms.length > 0,
isPostTypeSupported: tags && tags.types.some( ( type ) => type === postType ),
Expand Down

0 comments on commit b5fdf53

Please sign in to comment.