mirror of https://github.com/status-im/consul.git
Fixed nil check for token (#6179)
I can only assume we want to check for the retrieved `updatedToken` to not be nil, before accessing it below. `token` can't possibly be nil at this point, as we accessed `token.AccessorID` just before.
This commit is contained in:
parent
42dae36923
commit
ed4e64f6b2
|
@ -602,7 +602,7 @@ func (a *ACL) tokenSetInternal(args *structs.ACLTokenSetRequest, reply *structs.
|
|||
}
|
||||
|
||||
// Don't check expiration times here as it doesn't really matter.
|
||||
if _, updatedToken, err := a.srv.fsm.State().ACLTokenGetByAccessor(nil, token.AccessorID); err == nil && token != nil {
|
||||
if _, updatedToken, err := a.srv.fsm.State().ACLTokenGetByAccessor(nil, token.AccessorID); err == nil && updatedToken != nil {
|
||||
*reply = *updatedToken
|
||||
} else {
|
||||
return fmt.Errorf("Failed to retrieve the token after insertion")
|
||||
|
|
Loading…
Reference in New Issue