core: Don't panic if "required replace" path doesn't resolve to a value

This commit is contained in:
Martin Atkins 2018-08-27 18:14:34 -07:00
parent 6acf335e60
commit 7249a73f79
1 changed files with 5 additions and 3 deletions

View File

@ -214,11 +214,13 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) {
// the same type, but we'll allow it for robustness.
reqRep = append(reqRep, path)
}
if priorChangedVal != cty.NilVal {
eqV := plannedChangedVal.Equals(priorChangedVal)
if !eqV.IsKnown() || eqV.False() {
reqRep = append(reqRep, path)
}
}
}
if diags.HasErrors() {
return nil, diags.Err()
}