From aa36bcd0aa49a7ef1f08288006359e9d7f42c595 Mon Sep 17 00:00:00 2001 From: oooLowNeoNooo Date: Fri, 14 Nov 2025 08:16:03 +0100 Subject: [PATCH] graphql: add nil check in Transaction.Type() method (#33184) Add nil check before calling tx.Type() to prevent panic when transaction is not found. --- 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 }