Skip to content

A platform for community discussion. Free, open, simple.

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

Joffrey JAFFEUX0ed1cfd8d92b
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;
}