don't return invalid indices from model, fix for #10358

pull/21833/head
Bruno Windels 2019-08-06 16:32:01 +02:00
parent 505846ce53
commit 063eabed71
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}
}