fix: app crash when owner return err

This commit is contained in:
Anthony Laibe 2022-11-24 09:49:25 +01:00 committed by Anthony Laibe
parent d41fcaf8a9
commit 2f83fb05cf
1 changed files with 1 additions and 2 deletions

View File

@ -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