From 7bcab87242b2b5bddaa2fd5d8fe46ff8b14920d4 Mon Sep 17 00:00:00 2001 From: Niran Babalola Date: Tue, 17 Mar 2026 13:10:46 -0500 Subject: [PATCH] Fix null tx.to crash on contract creation transactions tx.to is null for contract creation transactions, causing "Cannot read properties of null (reading 'slice')" in the bundle detail page. Add null guards and display "Contract Creation" instead. --- src/app/bundles/[uuid]/page.tsx | 30 +++++++++++++++++++----------- src/lib/s3.ts | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/app/bundles/[uuid]/page.tsx b/src/app/bundles/[uuid]/page.tsx index cf0df3d..47e32ed 100644 --- a/src/app/bundles/[uuid]/page.tsx +++ b/src/app/bundles/[uuid]/page.tsx @@ -183,7 +183,9 @@ function TransactionDetails({
{tx.signer.slice(0, 6)}...{tx.signer.slice(-4)} →{" "} - {tx.to.slice(0, 6)}...{tx.to.slice(-4)} + {tx.to + ? `${tx.to.slice(0, 6)}...${tx.to.slice(-4)}` + : "Contract Creation"}
@@ -251,16 +253,22 @@ function TransactionDetails({ To - - - {tx.to} - - - + {tx.to ? ( + + + {tx.to} + + + + ) : ( + + Contract Creation + + )} diff --git a/src/lib/s3.ts b/src/lib/s3.ts index 32281e3..59c2f1b 100644 --- a/src/lib/s3.ts +++ b/src/lib/s3.ts @@ -93,7 +93,7 @@ export interface BundleTransaction { gas: string; maxFeePerGas: string; maxPriorityFeePerGas: string; - to: string; + to: string | null; value: string; accessList: unknown[]; input: string;