summaryrefslogtreecommitdiff
path: root/public/vendor/ot/codemirror-adapter.js
diff options
context:
space:
mode:
authorWu Cheng-Han2015-10-05 14:32:31 +0800
committerWu Cheng-Han2015-10-05 14:32:31 +0800
commit3f64ec79b72b79dc758435536c1096cb716235ac (patch)
treea12fd46e3a74cdf6835ef91976ad7e1e95e0f4b9 /public/vendor/ot/codemirror-adapter.js
parent53f26a777177510bf9801759fca6197144217b60 (diff)
Fixed OT not handle when selection is empty
Diffstat (limited to 'public/vendor/ot/codemirror-adapter.js')
-rwxr-xr-xpublic/vendor/ot/codemirror-adapter.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/public/vendor/ot/codemirror-adapter.js b/public/vendor/ot/codemirror-adapter.js
index 93727c58..c1601f22 100755
--- a/public/vendor/ot/codemirror-adapter.js
+++ b/public/vendor/ot/codemirror-adapter.js
@@ -247,7 +247,7 @@ ot.CodeMirrorAdapter = (function (global) {
CodeMirrorAdapter.prototype.setSelection = function (selection) {
var ranges = [];
- for (var i = 0; i < selection.ranges.length; i++) {
+ for (var i = 0; selection && i < selection.ranges.length; i++) {
var range = selection.ranges[i];
ranges[i] = {
anchor: this.cm.posFromIndex(range.anchor),