Skip to content

Clearing workspace while dragging with insertion marker crashes #2338

@NeilFraser

Description

@NeilFraser

In playground, create any two connected statement blocks:
Screen Shot 2019-03-25 at 14 42 13

On the console, enter:
setTimeout('workspace.clear()', 5000)

In the five seconds before clear runs, grab one of the blocks, disconnect it, and hover it close enough to the other blocks such that an insertion marker appears:
drag

The expected result is that all blocks are deleted.

The actual result is:

Uncaught TypeError: Cannot read property 'setAttribute' of null
    at Blockly.InsertionMarkerManager.disconnectMarker_ (insertion_marker_manager.js:666)
    at Blockly.InsertionMarkerManager.hidePreview_ (insertion_marker_manager.js:573)
    at Blockly.InsertionMarkerManager.maybeHidePreview_ (insertion_marker_manager.js:541)
    at Blockly.InsertionMarkerManager.update (insertion_marker_manager.js:243)
    at Blockly.BlockDragger.dragBlock (block_dragger.js:211)
    at Blockly.BlockDragger.endBlockDrag (block_dragger.js:225)
    at Blockly.TouchGesture.Blockly.Gesture.cancel (gesture.js:614)
    at Blockly.WorkspaceSvg.cancelCurrentGesture (workspace_svg.js:2347)
    at Blockly.BlockSvg.dispose (block_svg.js:874)
    at Blockly.WorkspaceSvg.Blockly.Workspace.clear (workspace.js:352)

Line 666. Figures...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions