From 36d25343f4c0ad0b8c2d01b684689073f35a302a Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 15 Jun 2021 23:07:50 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20hide=20insertion=20marker=20if?= =?UTF-8?q?=20it=E2=80=99s=20already=20gone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- core/insertion_marker_manager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index 2077333e4..0e038d666 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -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'); + } }; /**