From 0780c6250b0babaec35a2e77efba9b14075cc8ef Mon Sep 17 00:00:00 2001 From: Nicolas Corrarello Date: Wed, 29 Nov 2017 16:23:03 +0000 Subject: [PATCH] Checking if client is not nil before deleting token Signed-off-by: Nicolas Corrarello --- builtin/logical/nomad/secret_token.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/logical/nomad/secret_token.go b/builtin/logical/nomad/secret_token.go index 6e892659e6..70f261b7b0 100644 --- a/builtin/logical/nomad/secret_token.go +++ b/builtin/logical/nomad/secret_token.go @@ -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")