diff --git a/src/services/cw721/cw721.service.ts b/src/services/cw721/cw721.service.ts index 983b510b2..29e84390e 100644 --- a/src/services/cw721/cw721.service.ts +++ b/src/services/cw721/cw721.service.ts @@ -310,11 +310,13 @@ export default class Cw721HandlerService extends BullableService { .join(','); await knex.transaction(async (trx) => { if (newActDistinctByContract.length > 0) { - await knex - .raw( - `UPDATE cw721_contract SET no_holders = temp.no_holders from (VALUES ${stringListUpdates}) as temp(id, no_holders) where temp.id = cw721_contract.id` - ) - .transacting(trx); + if (stringListUpdates) { + await knex + .raw( + `UPDATE cw721_contract SET no_holders = temp.no_holders from (VALUES ${stringListUpdates}) as temp(id, no_holders) where temp.id = cw721_contract.id` + ) + .transacting(trx); + } await BlockCheckpoint.query() .transacting(trx) .insert({