Skip to content

Commit 343becd

Browse files
committed
fix: await Promise.race for transfer error checks and ensure timeout is cleared
1 parent 422054d commit 343becd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tokens/aoTokens/ao.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,12 @@ export async function checkTransferError(process: string, transferId: string): P
618618
});
619619

620620
try {
621-
return Promise.race([
621+
return await Promise.race([
622622
checkMessageResultForError(process, transferId).catch(() => null),
623623
checkMessageGraphqlResultForError(transferId).catch(() => null),
624624
timeout,
625625
]);
626626
} finally {
627-
clearTimeout(timeoutId);
627+
if (timeoutId) clearTimeout(timeoutId);
628628
}
629629
}

0 commit comments

Comments
 (0)