Skip to content

Commit 9e74f6f

Browse files
add: guard for rare deletion edge cases only
1 parent 117b7e8 commit 9e74f6f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

js/blocks.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,8 +2132,14 @@ class Blocks {
21322132
feedbackBlockObj.highlight();
21332133
this.activity.refreshCanvas();
21342134
setTimeout(() => {
2135-
feedbackBlockObj.unhighlight();
2136-
this.activity.refreshCanvas();
2135+
// Guard against rare deletion edge cases
2136+
if (
2137+
this.blockList[newBlock] === feedbackBlockObj &&
2138+
!feedbackBlockObj.trash
2139+
) {
2140+
feedbackBlockObj.unhighlight();
2141+
this.activity.refreshCanvas();
2142+
}
21372143
}, 220);
21382144
}
21392145
});

0 commit comments

Comments
 (0)