mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-23 07:21:22 +02:00
don't return invalid indices from model, fix for #10358
This commit is contained in:
parent
505846ce53
commit
063eabed71
@ -80,7 +80,8 @@ export default class EditorModel {
|
|||||||
const part = this._parts[index];
|
const part = this._parts[index];
|
||||||
return new DocumentPosition(index, part.text.length);
|
return new DocumentPosition(index, part.text.length);
|
||||||
} else {
|
} else {
|
||||||
return new DocumentPosition(0, 0);
|
// part index -1, as there are no parts to point at
|
||||||
|
return new DocumentPosition(-1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user