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

View File

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