diff --git a/packages/block-editor/src/hooks/utils.js b/packages/block-editor/src/hooks/utils.js index 373b7107b8aa6..6e1dd135d0a6b 100644 --- a/packages/block-editor/src/hooks/utils.js +++ b/packages/block-editor/src/hooks/utils.js @@ -123,7 +123,7 @@ export function useStyleOverride( { id, css } ) { useDispatch( blockEditorStore ) ); useEffect( () => { - if ( ! css ) return; + if ( ! id || ! css ) return; setStyleOverride( id, { css } ); return () => { deleteStyleOverride( id );