Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Composer: Not assuming element has leaves
Browse files Browse the repository at this point in the history
Summary:
Fixes a bug that where two dates are mentioned in a row, the second date
doesn't have leaf elements (not sure what those are) and explodes.
Instead, the second date just won't be highlighted

This affects more than just dates, as one can see in the attached task.

Reviewed By: claudiopro

Differential Revision: D16756786

fbshipit-source-id: 929600e1a5258120c70f2321eeace651afee3670
  • Loading branch information
Nitzan Raz authored and facebook-github-bot committed Aug 13, 2019
1 parent 22b7599 commit ce8bdd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/component/contents/DraftEditorBlock.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ class DraftEditorBlock extends React.Component<Props> {
return this.props.tree
.map((leafSet, ii) => {
const leavesForLeafSet = leafSet.get('leaves');
// T44088704
if (leavesForLeafSet.size === 0) {
return null;
}
const lastLeaf = leavesForLeafSet.size - 1;
const leaves = leavesForLeafSet
.map((leaf, jj) => {
Expand Down

0 comments on commit ce8bdd0

Please sign in to comment.