Skip to content

Commit

Permalink
Merge pull request #1346 from flipflopsandrice/master
Browse files Browse the repository at this point in the history
Added undefined check and fallback in Paste extension
  • Loading branch information
j0k3r authored Jul 28, 2017
2 parents c619e75 + 054cf97 commit 460579e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/extensions/paste.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@
// on empty line, rects is empty so we grab information from the first container of the range
if (rects.length) {
top += rects[0].top;
} else {
} else if (range.startContainer.getBoundingClientRect !== undefined) {
top += range.startContainer.getBoundingClientRect().top;
} else {
top += range.getBoundingClientRect().top;
}
}

Expand Down

0 comments on commit 460579e

Please sign in to comment.