diff --git a/packages/block-library/src/avatar/hooks.js b/packages/block-library/src/avatar/hooks.js index fcc7090547b14f..4394fd65a6da82 100644 --- a/packages/block-library/src/avatar/hooks.js +++ b/packages/block-library/src/avatar/hooks.js @@ -76,12 +76,14 @@ export function useUserAvatar( { userId, postId, postType } ) { }, [ postType, postId, userId ] ); - const avatarUrls = authorDetails - ? Object.values( authorDetails.avatar_urls ) - : null; - const sizes = authorDetails - ? Object.keys( authorDetails.avatar_urls ) - : null; + const avatarUrls = + authorDetails && authorDetails.avatar_urls !== undefined + ? Object.values( authorDetails.avatar_urls ) + : null; + const sizes = + authorDetails && authorDetails.avatar_urls !== undefined + ? Object.keys( authorDetails.avatar_urls ) + : null; const { minSize, maxSize } = getAvatarSizes( sizes ); const defaultAvatar = useDefaultAvatar(); return {