Skip to content

Commit

Permalink
Fix npm run docs:build crashing when a block.json lacks `supports…
Browse files Browse the repository at this point in the history
…` key. (#39241)
  • Loading branch information
ZebulanStanphill committed Mar 7, 2022
1 parent 71fcf86 commit bc9fbe4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/api-docs/gen-block-lib-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ function readBlockJSON( filename ) {
const blockjson = require( filename );

const sourcefile = getSourceFromFile( filename );
const supportsAugmented = augmentSupports( blockjson.supports );
const supportsList = processObjWithInnerKeys( supportsAugmented );
const supportsList =
blockjson.supports !== undefined
? processObjWithInnerKeys( augmentSupports( blockjson.supports ) )
: [];
const attributes = getTruthyKeys( blockjson.attributes );

return `
Expand Down

0 comments on commit bc9fbe4

Please sign in to comment.