Skip to content

Commit

Permalink
Fix panic if account error (#4521)
Browse files Browse the repository at this point in the history
Co-authored-by: CoderZhi <[email protected]>
  • Loading branch information
envestcc and CoderZhi authored Dec 17, 2024
1 parent 55e5e1c commit caa1c8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/web3server_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ func (svr *web3Handler) checkContractAddr(to string) (bool, error) {
return false, err
}
accountMeta, _, err := svr.coreService.Account(ioAddr)
return accountMeta.IsContract, err
if err != nil {
return false, err
}
return accountMeta.IsContract, nil
}

func (svr *web3Handler) getLogsWithFilter(from uint64, to uint64, addrs []string, topics [][]string) ([]*getLogsResult, error) {
Expand Down

0 comments on commit caa1c8c

Please sign in to comment.