Handle case where docRangeFromPoint returns null

This commit is contained in:
toasted-nutbread 2019-08-10 13:33:31 -04:00
parent 2edd4183a0
commit c22f8252b9

View File

@ -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());