From 67fa6df90181c13fd6bd2a8b447d63bc273d299d Mon Sep 17 00:00:00 2001 From: oooLowNeoNooo Date: Fri, 14 Nov 2025 08:03:41 +0100 Subject: [PATCH] Update graphql.go Add nil check before calling tx.Type() to prevent panic when transaction is not found. This matches the defensive pattern used in other Transaction resolver methods. --- graphql/graphql.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphql/graphql.go b/graphql/graphql.go index 0b2a77a3c4..55da3185dd 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -575,6 +575,9 @@ func (t *Transaction) getLogs(ctx context.Context, hash common.Hash) (*[]*Log, e func (t *Transaction) Type(ctx context.Context) *hexutil.Uint64 { tx, _ := t.resolve(ctx) + if tx == nil { + return nil + } txType := hexutil.Uint64(tx.Type()) return &txType }