diff --git a/src/component/selection/getVisibleSelectionRect.js b/src/component/selection/getVisibleSelectionRect.js index 6e3c55e41a..19332b1c8a 100644 --- a/src/component/selection/getVisibleSelectionRect.js +++ b/src/component/selection/getVisibleSelectionRect.js @@ -24,7 +24,7 @@ const getRangeBoundingClientRect = require('getRangeBoundingClientRect'); */ function getVisibleSelectionRect(global: any): ?FakeClientRect { const selection = global.getSelection(); - if (!selection.rangeCount) { + if (!selection?.rangeCount) { return null; }