Skip to content

Commit

Permalink
Fix Uncaught TypeError: Cannot read property 'nodeType' of null at ed… (
Browse files Browse the repository at this point in the history
facebookarchive#2330)

Summary:
facebookarchive#2204
Pull Request resolved: facebookarchive#2330

Reviewed By: claudiopro

Differential Revision: D20582792

Pulled By: mrkev

fbshipit-source-id: d96beaa1617ef82ba5663637f5daad254d9b17f7
  • Loading branch information
koistya authored and vilemj-Viclick committed Jul 16, 2020
1 parent f0dd8c8 commit 0019fd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/component/handlers/edit/editOnInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0019fd0

Please sign in to comment.