You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2023/11/01 11:08:02 UTC

(echarts) 01/01: fix(tooltip): use `remove` rather than `parentNode.removeChild` to fix potential NPE when its parent node doesn't exists. (apache/echarts#19248)

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch fix/tooltip-dispose-NPE
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 61e22c33ce44867282c4fd475a335bb8b3488cc6
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Wed Nov 1 19:04:22 2023 +0800

    fix(tooltip): use `remove` rather than `parentNode.removeChild` to fix potential NPE when its parent node doesn't exists. (apache/echarts#19248)
---
 src/component/tooltip/TooltipHTMLContent.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts
index da1960835..cc6ef51c5 100644
--- a/src/component/tooltip/TooltipHTMLContent.ts
+++ b/src/component/tooltip/TooltipHTMLContent.ts
@@ -520,7 +520,7 @@ class TooltipHTMLContent {
     }
 
     dispose() {
-        this.el.parentNode.removeChild(this.el);
+        this.el.remove();
         this.el = this._container = null;
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org