Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/nft-contract/approval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ export function internalNftRevokeAll({
assert(predecessorAccountId == token.owner_id, "only token owner can revoke");

//only revoke if the approved account IDs for the token is not empty
if (token.approved_account_ids && Object.keys(token.approved_account_ids).length === 0 && Object.getPrototypeOf(token.approved_account_ids) === Object.prototype) {
if (token.approved_account_ids && Object.keys(token.approved_account_ids).length !== 0 && Object.getPrototypeOf(token.approved_account_ids) === Object.prototype) {
//refund the approved account IDs to the caller of the function
refundApprovedAccountIds(predecessorAccountId, token.approved_account_ids);
//clear the approved account IDs
token.approved_account_ids = {};
//insert the token back into the tokens_by_id collection with the approved account IDs cleared
contract.tokensById.set(tokenId, token);
}
}
}