Return error before creating a client if conf is nil

This commit is contained in:
Nicolas Corrarello 2017-11-29 11:01:31 +00:00
parent e2be4bfd74
commit 4f91a71c29
No known key found for this signature in database
GPG Key ID: 6FD0D0E272A30401
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ func (b *backend) client(s logical.Storage) (*api.Client, error) {
return nil, err
}
if conf == nil {
return nil, err
}
nomadConf := api.DefaultConfig()
nomadConf.Address = conf.Address
nomadConf.SecretID = conf.Token