core: Don't crash EvalValidateProvisioner if no connection block present

This commit is contained in:
Martin Atkins 2018-05-11 14:58:39 -07:00
parent 5b1b564663
commit 509c6557dd
1 changed files with 5 additions and 0 deletions

View File

@ -189,6 +189,11 @@ func (n *EvalValidateProvisioner) validateConnConfig(ctx EvalContext, config *co
var diags tfdiags.Diagnostics
if config == nil || config.Config == nil {
// No block to validate
return diags
}
// We evaluate here just by evaluating the block and returning any
// diagnostics we get, since evaluation alone is enough to check for
// extraneous arguments and incorrectly-typed arguments.