mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
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.
This commit is contained in:
parent
488d987fc4
commit
67fa6df901
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue