diff --git a/app/soapbox/components/safe-embed.tsx b/app/soapbox/components/safe-embed.tsx index 23fbded14..b794bbed2 100644 --- a/app/soapbox/components/safe-embed.tsx +++ b/app/soapbox/components/safe-embed.tsx @@ -45,9 +45,7 @@ const SafeEmbed: React.FC = ({ } return () => { - if (iframeDocument) { - iframe.current?.contentWindow?.removeEventListener('message', handleMessage); - } + iframe.current?.contentWindow?.removeEventListener('message', handleMessage); }; }, [iframe.current, html]);