summaryrefslogtreecommitdiff
path: root/ext/fg/js/document.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-08-19 21:09:54 -0700
committerAlex Yatskov <alex@foosoft.net>2017-08-19 21:09:54 -0700
commitc4525027daee6e3fdbe206ae1aab0a9c5405d753 (patch)
treeadb99f326c6fa0c997bd27eb3d35ea17b51e38d9 /ext/fg/js/document.js
parentbecf549dcec03b1a5aff8ff9033fc7d14b8a2541 (diff)
bugfix and version
Diffstat (limited to 'ext/fg/js/document.js')
-rw-r--r--ext/fg/js/document.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js
index 26c85b40..b1e71777 100644
--- a/ext/fg/js/document.js
+++ b/ext/fg/js/document.js
@@ -76,7 +76,7 @@ function docRangeFromPoint(point) {
if (!document.caretRangeFromPoint) {
document.caretRangeFromPoint = (x, y) => {
const position = document.caretPositionFromPoint(x,y);
- if (position) {
+ if (position && position.offsetNode) {
const range = document.createRange();
range.setStart(position.offsetNode, position.offset);
range.setEnd(position.offsetNode, position.offset);