mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Changeset: Check .hasNext()
before calling .next()
This commit is contained in:
parent
1955e7b263
commit
44d99733c6
3 changed files with 6 additions and 4 deletions
|
@ -2072,7 +2072,9 @@ exports.inverse = (cs, lines, alines, pool) => {
|
|||
curLineNextOp.chars = 0;
|
||||
curLineOpIter = exports.opIterator(alinesGet(curLine));
|
||||
}
|
||||
if (!curLineNextOp.chars) curLineNextOp = curLineOpIter.next();
|
||||
if (!curLineNextOp.chars) {
|
||||
curLineNextOp = curLineOpIter.hasNext() ? curLineOpIter.next() : exports.newOp();
|
||||
}
|
||||
const charsToUse = Math.min(numChars, curLineNextOp.chars);
|
||||
func(charsToUse, curLineNextOp.attribs, charsToUse === curLineNextOp.chars &&
|
||||
curLineNextOp.lines > 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue