-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Editor: Update callers to handle when getBlockType returns undefined #34891
Block Editor: Update callers to handle when getBlockType returns undefined #34891
Conversation
…fined This commit has partial changes. It is based on some manual testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look @amustaque97! I left a few notes since some of the usages have a few gotchas. Feel free to ask if anything I noted was unclear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the code quality improvements @amustaque97! This one is good to land. (All tests are green and things look good with some minor smoke testing).
This commit has partial changes related to #34462. It is based on some manual testing.
Description
In most cases we either need to check if blockType is truthy before using it, or use optional chaining if it makes sense. eg
const icon = blockType?.icon;
How has this been tested?
Testing Instruction can be found here #34346 (comment)
Screenshots
Types of changes
Fix
Checklist:
*.native.js
files for terms that need renaming or removal).cc @gwwar