Handle no variation case in the block transform menu#41328
Conversation
|
I'll see if I can add an e2e test that would catch this in the future. |
|
Size Change: +5 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Mamaduka
left a comment
There was a problem hiding this comment.
I'm still not able to reproduce the issue. But based on the code and the fact that variations can be undefined, this guard clause makes sense.
|
I'm failing to put the right conditions in the e2e test to make it fail :) |
andrewserong
left a comment
There was a problem hiding this comment.
This change LGTM, but like some of the others, I wasn't able to reproduce the error.
It looks like a good defensive conditional to add, though, as I missed that in the useSelect call variations can be returned as a falsy value.
Thanks for putting up the fix!
|
I just cherry-picked this PR to the wp/6.0 branch to get it included in the next release: 0eaf63d |
closes #41321
What?
If you insert the classic block while the sidebar is open, you'll see the editor break.
Testing Instructions
1- Open the editor sidebar
2- Insert a classic block
3- The editor shouldn't break.