graphql: add nil check in Transaction.Type() method (#33184)

Add nil check before calling tx.Type() to prevent panic when transaction
is not found.
This commit is contained in:
oooLowNeoNooo 2025-11-14 08:16:03 +01:00 committed by Alvarez
parent b4de681a20
commit 131288688c

View file

@ -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
}