From 10d17c4d408d041b852519b14ac4c3152237a186 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 11 Jul 2014 20:20:08 -0700 Subject: [PATCH] terraform: don't ever pass a nil diff into Apply --- terraform/context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/terraform/context.go b/terraform/context.go index 30c8beac5..5d6c07291 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -453,6 +453,12 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc { // TODO(mitchellh): we need to verify the diff doesn't change // 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 for k, ad := range diff.Attributes { if ad.Type == DiffAttrOutput {