You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/07/30 15:55:56 UTC

[incubator-echarts] 01/02: fix(toolbox): fix null pointer access when using custom feature

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

shenyi pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit e95bc1f14fed2738bb11ff021c6352ab3b829a91
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Jul 30 23:54:46 2020 +0800

    fix(toolbox): fix null pointer access when using custom feature
---
 src/component/toolbox/ToolboxModel.ts | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/component/toolbox/ToolboxModel.ts b/src/component/toolbox/ToolboxModel.ts
index 10712e5..1d6a1da 100644
--- a/src/component/toolbox/ToolboxModel.ts
+++ b/src/component/toolbox/ToolboxModel.ts
@@ -90,10 +90,12 @@ class ToolboxModel extends ComponentModel<ToolboxOption> {
 
         zrUtil.each(this.option.feature, function (featureOpt, featureName) {
             const Feature = featureManager.getFeature(featureName);
-            if (Feature.getDefaultOption) {
-                Feature.defaultOption = Feature.getDefaultOption(ecModel);
+            if (Feature) {
+                if (Feature.getDefaultOption) {
+                    Feature.defaultOption = Feature.getDefaultOption(ecModel);
+                }
+                zrUtil.merge(featureOpt, Feature.defaultOption);
             }
-            Feature && zrUtil.merge(featureOpt, Feature.defaultOption);
         });
     }
 


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