Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Ensure that blockType is defined when accessing wrapperProps #56846

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading