diff --git a/tinymce-single/blocks/core/blockquote/register.js b/tinymce-single/blocks/core/blockquote/register.js index e1e9b4aabcbf9..fb60a65bc25e9 100644 --- a/tinymce-single/blocks/core/blockquote/register.js +++ b/tinymce-single/blocks/core/blockquote/register.js @@ -37,7 +37,7 @@ function onDeselect( block ) { var footer = block.querySelector( 'footer' ); - if ( ! footer.textContent ) { + if ( footer && ! footer.textContent ) { block.removeChild( footer ); } } diff --git a/tinymce-single/blocks/core/image/register.js b/tinymce-single/blocks/core/image/register.js index 6b72d9cebb409..535edbe7c07f3 100644 --- a/tinymce-single/blocks/core/image/register.js +++ b/tinymce-single/blocks/core/image/register.js @@ -25,7 +25,7 @@ function onDeselect( block ) { var figcaption = block.querySelector( 'figcaption' ); - if ( ! figcaption.textContent ) { + if ( figcaption && ! figcaption.textContent ) { block.removeChild( figcaption ); } } diff --git a/tinymce-single/blocks/core/table/register.js b/tinymce-single/blocks/core/table/register.js index 077bf3b1b9f32..8a52cc1063d2c 100644 --- a/tinymce-single/blocks/core/table/register.js +++ b/tinymce-single/blocks/core/table/register.js @@ -29,7 +29,7 @@ function onDeselect( block ) { var figcaption = block.querySelector( 'figcaption' ); - if ( ! figcaption.textContent ) { + if ( figcaption && ! figcaption.textContent ) { block.removeChild( figcaption ); } } diff --git a/tinymce-single/blocks/my-awesome-plugin/youtube/register.js b/tinymce-single/blocks/my-awesome-plugin/youtube/register.js index 3daba68efe770..ba7243984cfdc 100644 --- a/tinymce-single/blocks/my-awesome-plugin/youtube/register.js +++ b/tinymce-single/blocks/my-awesome-plugin/youtube/register.js @@ -25,7 +25,7 @@ function onDeselect( block ) { var figcaption = block.querySelector( 'figcaption' ); - if ( ! figcaption.textContent ) { + if ( figcaption && ! figcaption.textContent ) { block.removeChild( figcaption ); } }