return early when comparing Null values

This commit is contained in:
James Bardin 2018-11-26 18:10:01 -05:00
parent 6f4d86094f
commit 78256ae225
1 changed files with 2 additions and 0 deletions

View File

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