From 509c6557dd3fb95a9c9ba8f2c43ff7ec6af300bf Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 11 May 2018 14:58:39 -0700 Subject: [PATCH] core: Don't crash EvalValidateProvisioner if no connection block present --- terraform/eval_validate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terraform/eval_validate.go b/terraform/eval_validate.go index d16b6430d..caecbc169 100644 --- a/terraform/eval_validate.go +++ b/terraform/eval_validate.go @@ -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.