summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/js/language/text-scanner.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js
index 6fa7a454..af5cc8fe 100644
--- a/ext/js/language/text-scanner.js
+++ b/ext/js/language/text-scanner.js
@@ -145,7 +145,8 @@ class TextScanner extends EventDispatcher {
if (value) {
this._hookEvents();
- this._userHasNotSelectedAnythingManually = window.getSelection().isCollapsed;
+ const selection = window.getSelection();
+ this._userHasNotSelectedAnythingManually = (selection === null) ? true : selection.isCollapsed;
}
}