Skip to content

Commit

Permalink
Only query the last op's insertion string if it's actually an insert (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
jleen authored and Tim McClure committed Dec 12, 2016
1 parent fc68985 commit 7095d8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class Quill {
let deleted = this.editor.deleteText(0, length);
let applied = this.editor.applyDelta(delta);
let lastOp = applied.ops[applied.ops.length - 1];
if (lastOp != null && lastOp.insert[lastOp.insert.length-1] === '\n') {
if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\n') {
this.editor.deleteText(this.getLength() - 1, 1);
applied.delete(1);
}
Expand Down

0 comments on commit 7095d8b

Please sign in to comment.