From af457a3a9537725508d7dd88823ffd57308132ff Mon Sep 17 00:00:00 2001 From: "Alisa | Side.one" Date: Wed, 10 May 2023 00:30:33 +0800 Subject: [PATCH] fix: block error --- src/modules/[chain]/block/block.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/modules/[chain]/block/block.ts b/src/modules/[chain]/block/block.ts index 5c710b91..c561e94a 100644 --- a/src/modules/[chain]/block/block.ts +++ b/src/modules/[chain]/block/block.ts @@ -23,12 +23,16 @@ export const useBlockModule = defineStore('blockModule', { txsInRecents() { const txs = [] as { hash: string; tx: DecodedTxRaw }[]; this.recents.forEach((x) => - x.block?.data?.txs.forEach((tx: Uint8Array) => - txs.push({ - hash: hashTx(tx), - tx: decodeTxRaw(tx), - }) - ) + x.block?.data?.txs.forEach((tx: Uint8Array) => { + if (tx) { + try { + txs.push({ + hash: hashTx(tx), + tx: decodeTxRaw(tx), + }); + } catch (e) {} + } + }) ); return txs; },