plans/objchange: Don't panic if old or new values are null

This commit is contained in:
Martin Atkins 2018-09-06 17:13:25 -07:00
parent 972b28745b
commit 8048e9a585
1 changed files with 10 additions and 0 deletions

View File

@ -176,6 +176,16 @@ func assertValueCompatible(planned, actual cty.Value, path cty.Path) []error {
return errs
}
if actual.IsNull() {
if planned.IsNull() {
return nil
}
errs = append(errs, path.NewErrorf("was %#v, but now null", planned))
}
if planned.IsNull() {
errs = append(errs, path.NewErrorf("was null, but now %#v", actual))
}
ty := planned.Type()
switch {