diff --git a/projects/plugins/jetpack/extensions/blocks/podcast-player/utils.js b/projects/plugins/jetpack/extensions/blocks/podcast-player/utils.js index 83e6fffae15cc..ee482a88c7dc7 100644 --- a/projects/plugins/jetpack/extensions/blocks/podcast-player/utils.js +++ b/projects/plugins/jetpack/extensions/blocks/podcast-player/utils.js @@ -135,12 +135,12 @@ export function __maybeInjectStylesIntoSiteEditor() { const mediaElementCSS = document.querySelector( 'link#mediaelement-css' ); const wpMediaElementCSS = document.querySelector( 'link#wp-mediaelement-css' ); - if ( ! iframe.contentDocument.querySelector( 'link#mediaelement-css' ) ) { + if ( mediaElementCSS && ! iframe.contentDocument.querySelector( 'link#mediaelement-css' ) ) { iframe.contentDocument.head.appendChild( mediaElementCSS.cloneNode() ); mediaElementCSS.remove(); } - if ( ! iframe.contentDocument.querySelector( 'link#wp-mediaelement-css' ) ) { + if ( wpMediaElementCSS && ! iframe.contentDocument.querySelector( 'link#wp-mediaelement-css' ) ) { iframe.contentDocument.head.appendChild( wpMediaElementCSS.cloneNode() ); wpMediaElementCSS.remove(); }