Incorporating review comments

This commit is contained in:
Matthias Hanel
2020-07-27 19:19:43 -04:00
parent 00faefec06
commit 946e8415a0
2 changed files with 4 additions and 6 deletions

View File

@@ -2354,8 +2354,8 @@ func (s *Server) UpdateAccountClaims(a *Account, ac *jwt.AccountClaims) {
}
for _, i := range ac.Imports {
// check tmpAccounts with priority
acc := (*Account)(nil)
err := error(nil)
var acc *Account
var err error
if v, ok := s.tmpAccounts.Load(i.Account); ok {
acc = v.(*Account)
} else {

View File

@@ -1000,13 +1000,11 @@ func (c *client) processRemoteSub(argo []byte, hasOrigin bool) (err error) {
// When used, perform the fetch.
staticResolver := true
if res := srv.AccountResolver(); res != nil {
if _, ok := res.(*MemAccResolver); ok {
staticResolver = true
} else {
if _, ok := res.(*MemAccResolver); !ok {
staticResolver = false
}
}
acc := (*Account)(nil)
var acc *Account
if staticResolver {
acc, _ = srv.LookupAccount(accountName)
} else if v, ok := srv.accounts.Load(accountName); ok {