Skip to content

Commit

Permalink
Merge pull request #1331 from xiaoguzhu/LayaAir_3.1
Browse files Browse the repository at this point in the history
fix: when there is an exception when calling Delegate, it will cause …
  • Loading branch information
xiaoguzhu authored Jan 30, 2024
2 parents 2038ffb + 9fad043 commit 2cd6948
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/layaAir/laya/utils/Delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,15 @@ export class Delegate {
for (let i = 0; i < cnt; i += ITEM_LAYOUT) {
if (0 == arr[i + 3]) continue;
let fixedArgs = arr[i + 2];
if (fixedArgs != null)
arr[i].call(arr[i + 1], ...fixedArgs, ...args);
else
arr[i].call(arr[i + 1], ...args);
try {
if (fixedArgs != null)
arr[i].call(arr[i + 1], ...fixedArgs, ...args);
else
arr[i].call(arr[i + 1], ...args);
}
catch (err: any) {
console.error(err);
}
if (arr[i + 3] == 2) {
arr[i + 3] = 0;
this._flag = 2;
Expand Down

0 comments on commit 2cd6948

Please sign in to comment.