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 2021/11/23 02:13:09 UTC

[echarts] branch graphic-animation updated: feat(animation):fix null property access

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

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


The following commit(s) were added to refs/heads/graphic-animation by this push:
     new 1c9e3dc  feat(animation):fix null property access
1c9e3dc is described below

commit 1c9e3dcc4a6d0314f3cd72ceb95ac732dce84915
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Nov 23 10:11:53 2021 +0800

    feat(animation):fix null property access
---
 src/animation/customGraphicKeyframeAnimation.ts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/animation/customGraphicKeyframeAnimation.ts b/src/animation/customGraphicKeyframeAnimation.ts
index 64e82c1..845ccbf 100644
--- a/src/animation/customGraphicKeyframeAnimation.ts
+++ b/src/animation/customGraphicKeyframeAnimation.ts
@@ -46,11 +46,19 @@ export function applyKeyframeAnimation<T extends Record<string, any>>(
     }
 
     function applyKeyframeAnimationOnProp(propName: typeof ELEMENT_ANIMATABLE_PROPS[number]) {
+        if (propName && !(el as any)[propName]) {
+            return;
+        }
+
         const animator = el.animate(propName, animationOpts.loop);
         each(keyframes, kf => {
             // Stop current animation.
             const animators = el.animators;
             const kfValues = propName ? kf[propName] : kf;
+            if (!kfValues) {
+                return;
+            }
+
             let propKeys = keys(kfValues);
             if (!propName) {
                 // PENDING performance?

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