Checking if client is not nil before deleting token

Signed-off-by: Nicolas Corrarello <nicolas@corrarello.com>
This commit is contained in:
Nicolas Corrarello 2017-11-29 16:23:03 +00:00
parent 66840ac4db
commit 0780c6250b
No known key found for this signature in database
GPG Key ID: 6FD0D0E272A30401

View File

@ -46,6 +46,10 @@ func (b *backend) secretTokenRevoke(
return nil, err return nil, err
} }
if c == nil {
return nil, fmt.Errorf("Error connecting with Nomad")
}
accessorIDRaw, ok := req.Secret.InternalData["accessor_id"] accessorIDRaw, ok := req.Secret.InternalData["accessor_id"]
if !ok { if !ok {
return nil, fmt.Errorf("accessor_id is missing on the lease") return nil, fmt.Errorf("accessor_id is missing on the lease")