Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FlatTermSelector: Be more defensive about termIds
It's possible (likely through a bug elsehwere) for FlatTermSelector to completely crash the editor if it can't get termIds from the post being edited. This change prevents that crash. The error can happen when <FlatTermSelector> tries to access _termIds.join and _termIds.length even when _termIds is undefined. This is undefined if the current editor state doesn't have any changed for the relevent attribute [0] and the original post doesn't have the relevent attribute [1]. [0] https://github.com/WordPress/gutenberg/blob/4da057ecd6958d40b8f2a83db1152320e5f161e6/packages/editor/src/store/selectors.js#L329 [1] https://github.com/WordPress/gutenberg/blob/4da057ecd6958d40b8f2a83db1152320e5f161e6/packages/editor/src/store/selectors.js#L276
- Loading branch information