summaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-08-10 13:33:31 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-08-16 17:44:35 -0400
commitc22f8252b94b6c310c4cae30452e1975f3097d42 (patch)
treee4de54657964b8f747846f5747d080636d8c24b6 /ext/mixed/js
parent2edd4183a0f5061999af2a4e84bea87b6e70834b (diff)
Handle case where docRangeFromPoint returns null
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/display.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 3bb78fe1..8433c4b5 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -81,6 +81,9 @@ class Display {
const clickedElement = $(e.target);
const textSource = docRangeFromPoint({x: e.clientX, y: e.clientY});
+ if (textSource === null) {
+ return false;
+ }
textSource.setEndOffset(this.options.scanning.length);
const {definitions, length} = await apiTermsFind(textSource.text());