Skip to content

Commit

Permalink
bento amp-iframe: guard effect from running without a win (#36241)
Browse files Browse the repository at this point in the history
  • Loading branch information
samouri committed Oct 4, 2021
1 parent f23e77d commit 5d27a42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/amp-iframe/1.0/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export function BentoIframe({

useEffect(() => {
const iframe = iframeRef.current;
if (!iframe) {
// TODO(36239): Ensure that effects are properly isolated between test runs.
// Guarding for iframe truthiness should be enough.
if (!iframe?.ownerDocument.defaultView) {
return;
}
const win = toWin(iframe.ownerDocument.defaultView);
Expand Down

0 comments on commit 5d27a42

Please sign in to comment.