-
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
Crash if a field click deletes a block #7587
Comments
Interested to solve the issue |
Great, I'll assign you @Apoorvgarg-creator ! If you have any questions please feel free to ask here. |
Thank you ! |
@maribethb I am working on this issue, I cloned the repo and ran |
Looks like you're probably using an old version of node. Can you upgrade to Node v20 @Apoorvgarg-creator and see if that fixes the issue? |
@BeksOmega Thank you, It worked ! I was able to reproduce the error. Solving the issue. Thank you !! |
@maribethb @BeksOmega I have solved the bug with the solution proposed in the issue. |
* Fix: #7587 * Fix: Lint error * Fix: Move expression out of loop * Fix: No need to use temp variable
Check for duplicates
Description
If you have a block with a field that deletes the block*, Blockly will crash because the gesture handling code assumes the block continues to exist.
We can fix this in several ways:
bringBlockToFront
to the beginning ofdoFieldClick
(so that it happens before the field has a chance to handle the click)bringBlockToFront
make suredisposed
is false on the block before calling thebringToFront
method. This would prevent trying to move a dead/dying block.Reproduction steps
start
call.npm run start
to start the playground.Stack trace
Additional Info
This should also be fixed for icons since, #7588 is fixed.
To Fix
bringToFront
that checks ifthis.isDeadOrDying()
, and returns early if so.The text was updated successfully, but these errors were encountered: