diff --git a/src/mappings/multiTokens/events/token_account_created.ts b/src/mappings/multiTokens/events/token_account_created.ts index e8d691a7d..a9720120c 100644 --- a/src/mappings/multiTokens/events/token_account_created.ts +++ b/src/mappings/multiTokens/events/token_account_created.ts @@ -61,8 +61,8 @@ export async function tokenAccountCreated( }) if (tokenAccount !== null) { - tokenAccount!.createdAt = new Date(block.timestamp) - tokenAccount!.updatedAt = new Date(block.timestamp) + tokenAccount.createdAt = new Date(block.timestamp) + tokenAccount.updatedAt = new Date(block.timestamp) ctx.store.save(tokenAccount) return getEvent(item, data) @@ -89,7 +89,7 @@ export async function tokenAccountCreated( where: { id: `${data.collectionId}-${u8aToHex(data.accountId)}` }, }) - if (collectionAccount != null) { + if (collectionAccount === null) { const newCollectionAccount = new CollectionAccount({ id: `${data.collectionId}-${u8aToHex(data.accountId)}`, isFrozen: false, diff --git a/src/mappings/multiTokens/events/token_created.ts b/src/mappings/multiTokens/events/token_created.ts index 7c9862adb..67918ef07 100644 --- a/src/mappings/multiTokens/events/token_created.ts +++ b/src/mappings/multiTokens/events/token_created.ts @@ -799,12 +799,12 @@ export async function tokenCreated( where: { id: eventData.collectionId.toString() }, }) - if (collection != null) { + if (collection === null) { Sentry.captureMessage(`[TokenCreated] We have not found collection ${eventData.collectionId.toString()}.`, 'fatal') return getEvent(item, eventData) } - if (!callData) { + if (callData === null) { Sentry.captureMessage( `[TokenCreated] We could not parse call data for ${eventData.collectionId}-${eventData.tokenId}.`, 'fatal'