From 063eabed7108c1fa8d7e69b3553b4da79647d5e8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 6 Aug 2019 16:32:01 +0200 Subject: [PATCH] don't return invalid indices from model, fix for #10358 --- src/editor/model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/model.js b/src/editor/model.js index 74546b9bf8..759e13aabb 100644 --- a/src/editor/model.js +++ b/src/editor/model.js @@ -80,7 +80,8 @@ export default class EditorModel { const part = this._parts[index]; return new DocumentPosition(index, part.text.length); } else { - return new DocumentPosition(0, 0); + // part index -1, as there are no parts to point at + return new DocumentPosition(-1, 0); } }