mit-cml / workspace-multiselect

A Blockly plugin that allows you to drag, select and manipulate multiple blocks in the workspace.
https://hollowman6.github.io/workspace-multiselect/multi-workspace
11 stars 12 forks source link

Error when changing a block if it is no longer in the workspace #33

Closed bbrudastyy closed 8 months ago

bbrudastyy commented 8 months ago

We have a mechanism in our project that replaces blocks when a property is changed in a drop-down list, which initiates a block change event. Since the old block is deleted, an error occurs from the library, since the program cannot find the necessary block. This occurs in the multiselect file on line 242. I suggest at the beginning of the try statement to add a check for the existence of a block on the workspace and if there is no such block, then use return. If you approve of this behavior, I will create a PR

image
HollowMan6 commented 8 months ago

Looks like we just miss the catch statement in the case here (not sure why it's missing, maybe it got accidentally removed in a git conflict resolve). No need to add a condition check, I have made a commit https://github.com/mit-cml/workspace-multiselect/pull/30/commits/7fb8b3bf577ec1f824dbf29d20d56aa08d54c053 at #30 to fix this one.

bbrudastyy commented 8 months ago

Thanks