Skip to content

Commit f1d6a96

Browse files
authored
Add safe navigation operator to fix sentry issue (#457)
1 parent 03510fc commit f1d6a96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/views/medias/index.js.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
frame.setAttribute(attr, attrs[attr]);
5151
}
5252
frame.innerHTML = 'Your browser does not support iframes';
53-
53+
5454
placeholder.parentNode.insertBefore(frame, placeholder.nextSibling);
5555

5656
if (blockquote) {
@@ -85,7 +85,7 @@
8585
f = frame.getBoundingClientRect(),
8686
h = window.innerHeight || document.documentElement.clientHeight,
8787
w = window.innerWidth || document.documentElement.clientWidth;
88-
if (isVisible(frame)) frame.contentWindow.postMessage(['lazyLoad', h, w, f.top, f.left, f.bottom, f.right].join(';'), '*');
88+
if (isVisible(frame)) frame.contentWindow?.postMessage(['lazyLoad', h, w, f.top, f.left, f.bottom, f.right].join(';'), '*');
8989
}
9090
};
9191

0 commit comments

Comments
 (0)