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

wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/master by this push:
     new fd9e62d7f fix(tooltip): fix potential NPE when the parent node of the 
tooltip element doesn't exist (#19265)
fd9e62d7f is described below

commit fd9e62d7fdd88e95ddaf3c371353e8f6ca7d9e6a
Author: Zhongxiang Wang <y...@all-my-life.cn>
AuthorDate: Mon Nov 6 12:32:18 2023 +0800

    fix(tooltip): fix potential NPE when the parent node of the tooltip element 
doesn't exist (#19265)
    
    * fix(tooltip): use `remove` rather than `parentNode.removeChild` to fix 
potential NPE when its parent node doesn't exists. (apache/echarts#19248)
    
    * fix(tooltip): clearTimeout when disposing
    
    * fix(tooltip): still use `parentNode.removeChild` to reserve support for 
IE.
---
 src/component/tooltip/TooltipHTMLContent.ts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/component/tooltip/TooltipHTMLContent.ts 
b/src/component/tooltip/TooltipHTMLContent.ts
index da1960835..7e08b53f9 100644
--- a/src/component/tooltip/TooltipHTMLContent.ts
+++ b/src/component/tooltip/TooltipHTMLContent.ts
@@ -520,7 +520,11 @@ class TooltipHTMLContent {
     }
 
     dispose() {
-        this.el.parentNode.removeChild(this.el);
+        clearTimeout(this._hideTimeout);
+        clearTimeout(this._longHideTimeout);
+
+        const parentNode = this.el.parentNode;
+        parentNode && parentNode.removeChild(this.el);
         this.el = this._container = null;
     }
 


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

Reply via email to