pr feedback: check for null first argument
This commit is contained in:
parent
1f97062183
commit
3733856456
@ -261,6 +261,18 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case expandVal.Type().Equals(cty.DynamicPseudoType):
|
case expandVal.Type().Equals(cty.DynamicPseudoType):
|
||||||
|
if expandVal.IsNull() {
|
||||||
|
diags = append(diags, &hcl.Diagnostic{
|
||||||
|
Severity: hcl.DiagError,
|
||||||
|
Summary: "Invalid expanding argument value",
|
||||||
|
Detail: "The expanding argument (indicated by ...) must not be null.",
|
||||||
|
Subject: expandExpr.Range().Ptr(),
|
||||||
|
Context: e.Range().Ptr(),
|
||||||
|
Expression: expandExpr,
|
||||||
|
EvalContext: ctx,
|
||||||
|
})
|
||||||
|
return cty.DynamicVal, diags
|
||||||
|
}
|
||||||
return cty.DynamicVal, diags
|
return cty.DynamicVal, diags
|
||||||
case expandVal.Type().IsTupleType() || expandVal.Type().IsListType() || expandVal.Type().IsSetType():
|
case expandVal.Type().IsTupleType() || expandVal.Type().IsListType() || expandVal.Type().IsSetType():
|
||||||
if expandVal.IsNull() {
|
if expandVal.IsNull() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user