Skip to content

Commit

Permalink
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 committed May 11, 2021
1 parent cb8ecd0 commit 8185901
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 8185901

Please sign in to comment.