diff --git a/src/component/handlers/edit/editOnInput.js b/src/component/handlers/edit/editOnInput.js index 3cb49e7802..6b0b5a91ff 100644 --- a/src/component/handlers/edit/editOnInput.js +++ b/src/component/handlers/edit/editOnInput.js @@ -69,8 +69,8 @@ function editOnInput(editor: DraftEditor, e: SyntheticInputEvent<>): void { const {anchorNode, isCollapsed} = domSelection; const isNotTextOrElementNode = - anchorNode.nodeType !== Node.TEXT_NODE && - anchorNode.nodeType !== Node.ELEMENT_NODE; + anchorNode?.nodeType !== Node.TEXT_NODE && + anchorNode?.nodeType !== Node.ELEMENT_NODE; if (isNotTextOrElementNode) { // TODO: (t16149272) figure out context for this change