From 37f5c6ae2685a22a84a8dd736013893a3f0ff788 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 28 Sep 2016 16:47:58 -0700 Subject: [PATCH] terraform: ResourceConfig.Equal handles nil case --- terraform/resource.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terraform/resource.go b/terraform/resource.go index ba4251b0f..db6db9ffd 100644 --- a/terraform/resource.go +++ b/terraform/resource.go @@ -115,6 +115,11 @@ func (c *ResourceConfig) DeepCopy() *ResourceConfig { // Equal checks the equality of two resource configs. func (c *ResourceConfig) Equal(c2 *ResourceConfig) bool { + // If either are nil, then they're only equal if they're both nil + if c == nil || c2 == nil { + return c == c2 + } + // Two resource configs if their exported properties are equal. // We don't compare "raw" because it is never used again after // initialization and for all intents and purposes they are equal