Skip to content

Clearing the name of a procedure parameter (even temporarily) breaks everything #1958

@rachel-fenichel

Description

@rachel-fenichel

Problem statement

image

Trying to rename x to another name by deleting x and then starting to type causes major problems.

This is because there's an intermediate state where it tries to create a variable with the empty name. Then calls to allUsedVariables and fail, as does mutateCallers.

If the variable name is empty we should not attempt to create a variable with that name. (Do we just keep the old name around instead, and revert to it if they end editing there?)

Stack Traces

procedures.js:133 Uncaught TypeError: Cannot read property 'name' of null
    at Blockly.BlockSvg.mutationToDom (procedures.js:133)
    at Object.Blockly.Procedures.mutateCallers (procedures.js:281)
    at Blockly.BlockSvg.compose (procedures.js:225)
    at Blockly.Mutator.workspaceChanged_ (mutator.js:339)
    at Blockly.WorkspaceSvg.Blockly.Workspace.fireChangeListener (workspace.js:436)
    at Blockly.Events.fireNow_ (events.js:160)```

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions