diff --git a/src/nft-contract/approval.ts b/src/nft-contract/approval.ts index 9bd1745..0a97114 100644 --- a/src/nft-contract/approval.ts +++ b/src/nft-contract/approval.ts @@ -166,7 +166,7 @@ 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 @@ -174,4 +174,4 @@ export function internalNftRevokeAll({ //insert the token back into the tokens_by_id collection with the approved account IDs cleared contract.tokensById.set(tokenId, token); } -} \ No newline at end of file +}