Skip to content

Commit caa1c8c

Browse files
envestccCoderZhi
andauthored
Fix panic if account error (#4521)
Co-authored-by: CoderZhi <[email protected]>
1 parent 55e5e1c commit caa1c8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/web3server_utils.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ func (svr *web3Handler) checkContractAddr(to string) (bool, error) {
181181
return false, err
182182
}
183183
accountMeta, _, err := svr.coreService.Account(ioAddr)
184-
return accountMeta.IsContract, err
184+
if err != nil {
185+
return false, err
186+
}
187+
return accountMeta.IsContract, nil
185188
}
186189

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

0 commit comments

Comments
 (0)