mirror of
https://github.com/galacean/engine.git
synced 2026-06-21 03:46:09 +08:00
fix: fault tolerance in the absence of a callback function (#2394)
This commit is contained in:
@@ -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 = <Function>script[funcName].bind(script);
|
||||
const handler = <Function>script[funcName]?.bind(script);
|
||||
handler && handlers.push(handler);
|
||||
}
|
||||
eventHandlers.push(eventHandler);
|
||||
|
||||
Reference in New Issue
Block a user