Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 24, 2024
1 parent f6ec31e commit cb49561
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/store/private-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export const getAllPatterns = createRegistrySelector( ( select ) =>
createSelector( ( state ) => {
// This setting is left for back compat.
const {
__experimentalBlockPatterns,
__experimentalBlockPatterns = [],
__experimentalFetchBlockPatterns,
__experimentalUserPatternCategories = [],
__experimentalReusableBlocks = [],
Expand Down
5 changes: 4 additions & 1 deletion packages/core-data/src/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export async function fetchBlockPatterns() {
const restPatterns = await apiFetch( {
path: '/wp/v2/block-patterns/patterns',
} );
return restPatterns?.map( ( pattern ) =>
if ( ! restPatterns ) {
return [];
}
return restPatterns.map( ( pattern ) =>
Object.fromEntries(
Object.entries( pattern ).map( ( [ key, value ] ) => [
camelCase( key ),
Expand Down

0 comments on commit cb49561

Please sign in to comment.