Skip to content

Commit

Permalink
Fix null pointer exception in estimate gas API
Browse files Browse the repository at this point in the history
  • Loading branch information
trinhdn97 committed Jan 31, 2021
1 parent 8bd0cc8 commit 8f40d01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mainchain/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,9 @@ func (s *PublicKaiAPI) EstimateGas(ctx context.Context, args types.CallArgsJSON,
if err != nil {
return 0, err
}
if block == nil {
return 0, errors.New("block not found")
}
hi = block.GasLimit()
}
cap = hi
Expand Down

0 comments on commit 8f40d01

Please sign in to comment.