fix: prevent crash when dragging blocks after rapidly creating projects - #7985
Open
UtkarshAnandd wants to merge 1 commit into
Open
fix: prevent crash when dragging blocks after rapidly creating projects#7985UtkarshAnandd wants to merge 1 commit into
UtkarshAnandd wants to merge 1 commit into
Conversation
Cannot read properties of undefined (reading 'connections') crashed on rapid next-project + play. myBlock === null never caught the undefined case, which is what blockList[blk] actually returns for an index past the currently-populated portion of the array. Widened the guard to a falsy check (covers both null and undefined) and added a regression test.
UtkarshAnandd
requested review from
Ashutoshx7,
omsuneri and
walterbender
as code owners
August 7, 2026 10:43
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7985 +/- ##
=======================================
Coverage 62.13% 62.13%
=======================================
Files 187 187
Lines 58275 58275
=======================================
+ Hits 36209 36211 +2
+ Misses 22066 22064 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Maybe there is a typo in your description? I don't know what the "Next Project" button is, so I don't know how to reproduce this bug or test your solution. |
Contributor
Author
|
@walterbender Thanks — it was a typo. I meant New Project , not “Next Project.” I’ve updated the PR description with the exact reproduction and verification steps. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a crash that could occur when repeatedly using New Project and then Play before dragging a block onto the workspace.
The drag controller could encounter an uninitialised/undefined entry in
blockListand attempt to read itsconnectionsproperty. This PR adds a guard in_calculateDragGroupso invalid block entries are safely ignored.Changes
_calculateDragGroupagainst undefinedblockListentries.nullandundefinedblocks.Testing
Quick verification:
Before this fix, this could crash. With this PR, the block is added normally.