Skip to content

Commit

Permalink
Fix when anchorNode is undefined instead of null
Browse files Browse the repository at this point in the history
Fixes facebookarchive#1399

`nativeSelection.anchorNode` can be undefined instead of null, so I'm changing the condition to handle this use case.
  • Loading branch information
tleunen authored Sep 25, 2017
1 parent baa536e commit 8edacbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/component/handlers/edit/editOnBeforeInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function editOnBeforeInput(
const nativeSelection = global.getSelection();
// Selection is necessarily collapsed at this point due to earlier check.
if (
nativeSelection.anchorNode !== null &&
nativeSelection.anchorNode &&
nativeSelection.anchorNode.nodeType === Node.TEXT_NODE
) {
// See isTabHTMLSpanElement in chromium EditingUtilities.cpp.
Expand Down

0 comments on commit 8edacbf

Please sign in to comment.