From 815b767a46f03513143b15cbd200f213306f7d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Thu, 13 May 2021 16:57:06 +0200 Subject: [PATCH] Site logo block: Only request entity when we have a sitelogo defined (#31673) --- packages/block-library/src/site-logo/edit.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/block-library/src/site-logo/edit.js b/packages/block-library/src/site-logo/edit.js index 6f43fb55e4575..05e225513392d 100644 --- a/packages/block-library/src/site-logo/edit.js +++ b/packages/block-library/src/site-logo/edit.js @@ -260,11 +260,13 @@ export default function LogoEdit( { 'root', 'site' ); - const mediaItem = select( coreStore ).getEntityRecord( - 'root', - 'media', - siteSettings.site_logo - ); + const mediaItem = siteSettings.site_logo + ? select( coreStore ).getEntityRecord( + 'root', + 'media', + siteSettings.site_logo + ) + : null; return { mediaItemData: mediaItem && { url: mediaItem.source_url,