Skip to content

variablesMap.changeVariableType does not remove empty maps which causes a crash when the workspace is cleared() #9421

@stefan-stanca

Description

@stefan-stanca

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

Image

Reproduction steps

  1. Create a workspace with a single variable of type "Int"
  2. const variablesMap = workspace.current?.getVariableMap();
    variablesMap.changeVariableType(variable, "Bool");
  3. workspace.current.clear();
Image

Any workaround would be appreciated as it's currently blocking.

Priority

Blocker

Stack trace

react-dom.development.js:12056 Uncaught Error: Non-empty variable map
    at _Gb.clear (variable_map.ts:67:13)
    at _Ab.clear (workspace.ts:399:26)
    at _Ab.clear (workspace_svg.ts:2358:11)

Screenshots

No response

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrongissue: triageIssues awaiting triage by a Blockly team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions