Skip to content

Commit

Permalink
Site logo block: Only request entity when we have a sitelogo defined (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
david-szabo97 authored May 13, 2021
1 parent 4c09aff commit 815b767
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/block-library/src/site-logo/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 815b767

Please sign in to comment.