From e4913fe29be7e39416c83313b0cde56dca8e5e78 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 1 Feb 2022 05:48:45 +0000 Subject: [PATCH] Audio: Avoid error when locked (#38282) --- packages/block-library/src/audio/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/audio/edit.js b/packages/block-library/src/audio/edit.js index 8c944cae9a633a..ce2b95de66e3a8 100644 --- a/packages/block-library/src/audio/edit.js +++ b/packages/block-library/src/audio/edit.js @@ -89,7 +89,7 @@ function AudioEdit( { const embedBlock = createUpgradedEmbedBlock( { attributes: { url: newSrc }, } ); - if ( undefined !== embedBlock ) { + if ( undefined !== embedBlock && onReplace ) { onReplace( embedBlock ); return; }