Skip to content

Commit

Permalink
[RNMobile] Ensure that blockType is defined when accessing `wrapper…
Browse files Browse the repository at this point in the history
…Props` (#56846)

* Check if native blockType exists before assigning wrapperProps

* Update CHANGELOG
  • Loading branch information
derekblank authored Dec 12, 2023
1 parent a43ffa4 commit 45d7bab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/block-editor/src/components/block-list/block.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,13 @@ function BlockListBlock( {
);

// Block level styles.
const wrapperProps = getWrapperProps(
attributes,
blockType.getEditWrapperProps
);
let wrapperProps = {};
if ( blockType?.getEditWrapperProps ) {
wrapperProps = getWrapperProps(
attributes,
blockType.getEditWrapperProps
);
}

// Inherited styles merged with block level styles.
const mergedStyle = useMemo( () => {
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ For each user feature we should also add a importance categorization label to i
## Unreleased
- [*] [internal] Move InserterButton from components package to block-editor package [#56494]
- [*] [internal] Move ImageLinkDestinationsScreen from components package to block-editor package [#56775]
- [*] Fix crash when blockType wrapperProps are not defined [#56846]
- [*] Guard against an Image block styles crash due to null block values [#56903]
- [**] Fix crash when sharing unsupported media types on Android [#56791]

Expand Down

1 comment on commit 45d7bab

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 45d7bab.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7178569942
📝 Reported issues:

Please sign in to comment.