-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: prevent crash when clicking on a field to delete a block #7621
Conversation
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.
Heya @Apoorvgarg-creator Thank you for your work on this :D
I gave it a look and I /think/ we can move the isDeadOrDying
check out of the loop, so that it's at the top of the function. Can you give that a try for me and tell me if it works?
core/block_svg.ts
Outdated
const isDeadOrDying: boolean = block.isDeadOrDying(); | ||
if (isDeadOrDying) { |
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.
If you're immediately checking it, there's no need to store the value in a temp variable!
const isDeadOrDying: boolean = block.isDeadOrDying(); | |
if (isDeadOrDying) { | |
if (block.isDeadOrDying()) { |
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.
This looks great! Thank you for the fix @Apoorvgarg-creator =)
The basics
The details
Resolves
Fixes #7587
Proposed Changes
The change is to check if the block is dead or is in dying state before accessing it in the
bringToFront
function.Reason for Changes
Test Coverage
Documentation
Additional Information