Fixes identified by TS

This commit is contained in:
Michael Telatynski 2021-06-30 13:03:29 +01:00
parent e768ecb3d0
commit 0a5abb09f4
2 changed files with 5 additions and 4 deletions

View file

@ -395,7 +395,7 @@ export default class EditMessageComposer extends React.Component<IProps, IState>
const sel = document.getSelection();
let caret;
if (sel.focusNode) {
caret = getCaretOffsetAndText(this.editorRef.current, sel).caret;
caret = getCaretOffsetAndText(this.editorRef.current?.editorRef.current, sel).caret;
}
const parts = this.model.serializeParts();
// if caret is undefined because for some reason there isn't a valid selection,