Skip to content

Commit

Permalink
fix(dom): getBoundingClientRect check that el is defined (#4139)
Browse files Browse the repository at this point in the history
Verify that el is defined so that we don't throw if we get to this function with an undefined el
  • Loading branch information
brandonocasey authored and gkatsev committed Mar 2, 2017
1 parent a2b1a33 commit fb88ae2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ export function unblockTextSelection() {
* Always returns a plain
*/
export function getBoundingClientRect(el) {
if (el.getBoundingClientRect && el.parentNode) {
if (el && el.getBoundingClientRect && el.parentNode) {
const rect = el.getBoundingClientRect();
const result = {};

Expand Down

0 comments on commit fb88ae2

Please sign in to comment.