Skip to content

Commit

Permalink
fix(zetaclient): add block by number result nil check (#2882)
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera authored Sep 14, 2024
1 parent 9988584 commit 8ad6192
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zetaclient/chains/evm/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ func (ob *Observer) BlockByNumber(blockNumber int) (*ethrpc.Block, error) {
if err != nil {
return nil, err
}
if block == nil {
return nil, fmt.Errorf("block not found: %d", blockNumber)
}
for i := range block.Transactions {
err := evm.ValidateEvmTransaction(&block.Transactions[i])
if err != nil {
Expand Down

0 comments on commit 8ad6192

Please sign in to comment.