mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
Fixed OT not handle when selection is empty
This commit is contained in:
parent
53f26a7771
commit
3f64ec79b7
2 changed files with 2 additions and 2 deletions
2
public/vendor/ot/codemirror-adapter.js
vendored
2
public/vendor/ot/codemirror-adapter.js
vendored
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue