From 5909eb1b5e1b0ece6cfdf53b169e64c28aa55e9b Mon Sep 17 00:00:00 2001 From: Arthur Sudre Date: Tue, 11 Oct 2022 10:17:02 +0200 Subject: [PATCH] Fix selection throwing when null --- src/component/selection/getVisibleSelectionRect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }