From 0e79858d56b2ce5becab8929b09746e7157a44cb Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Thu, 21 Jul 2016 12:59:28 -0700 Subject: [PATCH] fix #809 --- core/quill.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/quill.js b/core/quill.js index 194ea0e8f8..410ead6658 100644 --- a/core/quill.js +++ b/core/quill.js @@ -292,8 +292,10 @@ class Quill { delta = new Delta(delta.slice()); } let change = this.editor.applyDelta(delta, source); - range = shiftRange(range, change, source); - this.setSelection(range, Emitter.sources.SILENT); + if (range != null) { + range = shiftRange(range, change, source); + this.setSelection(range, Emitter.sources.SILENT); + } return change; } }