diff --git a/canvas_modules/common-canvas/src/common-canvas/svg-canvas-renderer.js b/canvas_modules/common-canvas/src/common-canvas/svg-canvas-renderer.js index 4c10aa5518..1a81dd47ab 100644 --- a/canvas_modules/common-canvas/src/common-canvas/svg-canvas-renderer.js +++ b/canvas_modules/common-canvas/src/common-canvas/svg-canvas-renderer.js @@ -2296,10 +2296,12 @@ export default class SVGCanvasRenderer { hideEditIcon(spanObj) { if (!this.mouseOverLabelEditIcon) { const labelObj = spanObj.parentElement; - const foreignObj = labelObj.parentElement; - const nodeObj = foreignObj.parentElement; - const nodeGrpSel = d3.select(nodeObj); - nodeGrpSel.selectAll(".d3-label-edit-icon-group").remove(); + if (labelObj) { + const foreignObj = labelObj.parentElement; + const nodeObj = foreignObj.parentElement; + const nodeGrpSel = d3.select(nodeObj); + nodeGrpSel.selectAll(".d3-label-edit-icon-group").remove(); + } } }