Skip to content

Commit

Permalink
fix(transactions): remove subscription if available (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
wozgun authored May 7, 2022
1 parent ac94c9a commit e99f05c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const awaitTransactionSignatureConfirmation = async (
});

//@ts-ignore
if (connection._signatureSubscriptions[subId]) {
if (connection._signatureSubscriptions && connection._signatureSubscriptions[subId]) {
connection.removeSignatureListener(subId);
}
done = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/spl-utils/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export const awaitTransactionSignatureConfirmation = async (
});

//@ts-ignore
if (connection._signatureSubscriptions[subId]) {
if (connection._signatureSubscriptions && connection._signatureSubscriptions[subId]) {
connection.removeSignatureListener(subId);
}
done = true;
Expand Down

1 comment on commit e99f05c

@vercel
Copy link

@vercel vercel bot commented on e99f05c May 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.