Skip to content

Commit

Permalink
Guard against negative lineIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 29, 2019
1 parent c46a0cd commit 181411b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rich-text/src/get-parent-line-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getParentLineIndex( { text, formats }, lineIndex ) {

let index = lineIndex;

while ( index-- ) {
while ( index-- <= 0 ) {
if ( text[ index ] !== LINE_SEPARATOR ) {
continue;
}
Expand Down

0 comments on commit 181411b

Please sign in to comment.