From aefd9443472db0cbc7d36c5bcb50ca6911712ca2 Mon Sep 17 00:00:00 2001 From: luzhuang <364439895@qq.com> Date: Wed, 30 Oct 2024 19:00:40 +0800 Subject: [PATCH] fix: fault tolerance in the absence of a callback function (#2394) --- packages/core/src/animation/Animator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/animation/Animator.ts b/packages/core/src/animation/Animator.ts index ecf0da396..b3c92ed4e 100644 --- a/packages/core/src/animation/Animator.ts +++ b/packages/core/src/animation/Animator.ts @@ -406,7 +406,7 @@ export class Animator extends Component { handlers.length = 0; for (let j = scriptCount - 1; j >= 0; j--) { const script = scripts[j]; - const handler = script[funcName].bind(script); + const handler = script[funcName]?.bind(script); handler && handlers.push(handler); } eventHandlers.push(eventHandler);