From 0ed1cfd8d92b1a60767f5f5aba51b071d63ebde8 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 21 May 2019 21:26:54 +0200 Subject: [PATCH] FIX: ensures we have an elementFromPoint before using it (#7583) --- .../discourse/components/scrolling-post-stream.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 b/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 index a1f101a8dc0..dd26007e101 100644 --- a/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 +++ b/app/assets/javascripts/discourse/components/scrolling-post-stream.js.es6 @@ -72,7 +72,11 @@ export default MountWidget.extend({ // We use this because watching videos fullscreen in Chrome was super buggy // otherwise. Thanks to arrendek from q23 for the technique. - if (document.elementFromPoint(0, 0).tagName.toUpperCase() === "IFRAME") { + const topLeftCornerElement = document.elementFromPoint(0, 0); + if ( + topLeftCornerElement && + topLeftCornerElement.tagName.toUpperCase() === "IFRAME" + ) { return; }