fix: app crash when owner return err
This commit is contained in:
parent
d41fcaf8a9
commit
2f83fb05cf
|
@ -121,7 +121,7 @@ func (api *API) OwnerOf(ctx context.Context, chainID uint64, username string) (*
|
||||||
callOpts := &bind.CallOpts{Context: ctx, Pending: false}
|
callOpts := &bind.CallOpts{Context: ctx, Pending: false}
|
||||||
owner, err := registry.Owner(callOpts, nameHash(username))
|
owner, err := registry.Owner(callOpts, nameHash(username))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &owner, nil
|
return &owner, nil
|
||||||
|
@ -205,7 +205,6 @@ func (api *API) usernameRegistrarAddr(ctx context.Context, chainID uint64) (comm
|
||||||
log.Info("obtaining username registrar address")
|
log.Info("obtaining username registrar address")
|
||||||
api.addrPerChainMutex.Lock()
|
api.addrPerChainMutex.Lock()
|
||||||
defer api.addrPerChainMutex.Unlock()
|
defer api.addrPerChainMutex.Unlock()
|
||||||
|
|
||||||
addr, ok := api.addrPerChain[chainID]
|
addr, ok := api.addrPerChain[chainID]
|
||||||
if ok {
|
if ok {
|
||||||
return addr, nil
|
return addr, nil
|
||||||
|
|
Loading…
Reference in New Issue