Don’t hide insertion marker if it’s already gone

Fixes #2338.

I also looked at having workspace.clear delete any insertion marker, but there doesn’t appear to be a public API for this.  Shouldn’t matter, this should be sufficient.
This commit is contained in:
Neil Fraser
2021-06-15 23:07:50 -07:00
committed by Neil Fraser
parent 9fa6b03789
commit 36d25343f4

View File

@@ -674,7 +674,10 @@ Blockly.InsertionMarkerManager.prototype.hideInsertionMarker_ = function() {
}
this.markerConnection_ = null;
imBlock.getSvgRoot().setAttribute('visibility', 'hidden');
var svg = imBlock.getSvgRoot();
if (svg) {
svg.setAttribute('visibility', 'hidden');
}
};
/**