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
…… (#2330)

Summary:
facebookarchive/draft-js#2204
Pull Request resolved: facebookarchive/draft-js#2330

Reviewed By: claudiopro

Differential Revision: D20582792

Pulled By: mrkev

fbshipit-source-id: d96beaa1617ef82ba5663637f5daad254d9b17f7
  • Loading branch information
koistya authored and facebook-github-bot committed Mar 24, 2020
1 parent 6976198 commit 36c476a
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 36c476a

Please sign in to comment.