FIX: ensures we have an elementFromPoint before using it (#7583)

FIX: ensures we have an elementFromPoint before using it (#7583)

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 a1f101a..dd26007 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;
     }

GitHub sha: 0ed1cfd8

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: