Skip to content
Prev Previous commit
Next Next commit
Check that support is defined in useCustomSides
Previously the hook was only used if the feature was known to be
supported. Now that it is used in checking the spacing configuration,
it is possible for `support` to be undefined here.
  • Loading branch information
stacimc committed Aug 11, 2021
commit fb26fd65e9f48fe0803e4d9dce8d43cecf089c22
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function useCustomSides( blockName, feature ) {
const support = getBlockSupport( blockName, SPACING_SUPPORT_KEY );

// Skip when setting is boolean as theme isn't setting arbitrary sides.
if ( typeof support?.[ feature ] === 'boolean' ) {
if ( ! support || typeof support[ feature ] === 'boolean' ) {
return;
}

Expand Down