summaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authorAlex Yatskov <FooSoft@users.noreply.github.com>2019-08-17 09:04:05 -0700
committerGitHub <noreply@github.com>2019-08-17 09:04:05 -0700
commit778d1d6e79c4cc73262d6af05aa4219c19df10d1 (patch)
treed5ec4369fb51b8c0a6b714484299d2e98d082fd0 /ext/mixed
parent6a96555d4c2b4631815ca9f1c97d1d366015a807 (diff)
parentc22f8252b94b6c310c4cae30452e1975f3097d42 (diff)
Merge pull request #177 from toasted-nutbread/doc-range-from-point-improvements
Doc range from point improvements
Diffstat (limited to 'ext/mixed')
-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());