terraform: don't ever pass a nil diff into Apply

This commit is contained in:
Mitchell Hashimoto 2014-07-11 20:20:08 -07:00
parent 5a9a960392
commit 10d17c4d40
1 changed files with 6 additions and 0 deletions

View File

@ -453,6 +453,12 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc {
// TODO(mitchellh): we need to verify the diff doesn't change // TODO(mitchellh): we need to verify the diff doesn't change
// anything and that the diff has no computed values (pre-computed) // anything and that the diff has no computed values (pre-computed)
// If we don't have a diff, just make an empty one
if diff == nil {
diff = new(ResourceDiff)
diff.init()
}
// Remove any output values from the diff // Remove any output values from the diff
for k, ad := range diff.Attributes { for k, ad := range diff.Attributes {
if ad.Type == DiffAttrOutput { if ad.Type == DiffAttrOutput {