1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-31 11:26:45 +02:00

fix(dom): getBoundingClientRect check that el is defined (#4139)

Verify that el is defined so that we don't throw if we get to this function with an undefined el
This commit is contained in:
Brandon Casey 2017-03-02 14:51:19 -05:00 committed by Gary Katsevman
parent a2b1a33606
commit fb88ae2bfc

View File

@ -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 = {};