diff --git a/packages/block-editor/src/components/rich-text/utils.js b/packages/block-editor/src/components/rich-text/utils.js index 16bcb2dd23a2c1..f1385eda82e26f 100644 --- a/packages/block-editor/src/components/rich-text/utils.js +++ b/packages/block-editor/src/components/rich-text/utils.js @@ -5,7 +5,7 @@ import { regexp } from '@wordpress/shortcode'; import deprecated from '@wordpress/deprecated'; export function addActiveFormats( value, activeFormats ) { - if ( activeFormats.length ) { + if ( activeFormats?.length ) { let index = value.formats.length; while ( index-- ) {