Skip to content

Commit 3e82c9e

Browse files
eth/api: fix potential nil deref in AccountRange (#21710)
* Fix potential nil pointer error when neither block number nor hash is specified to accountRange * Update error description
1 parent 9d25f34 commit 3e82c9e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

eth/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, sta
389389
if err != nil {
390390
return state.IteratorDump{}, err
391391
}
392+
} else {
393+
return state.IteratorDump{}, errors.New("either block number or block hash must be specified")
392394
}
393395

394396
if maxResults > AccountRangeMaxResults || maxResults <= 0 {

0 commit comments

Comments
 (0)