From f8bfc0a80da76f89813862cf17a632137983eef1 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 26 May 2017 15:04:56 -0400 Subject: [PATCH] check for empty diff in CountHook.PreApply Make sure we don't try to count anything from a nil diff. --- backend/local/hook_count.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/local/hook_count.go b/backend/local/hook_count.go index 9c2d030b0d..4708159dc0 100644 --- a/backend/local/hook_count.go +++ b/backend/local/hook_count.go @@ -42,6 +42,10 @@ func (h *CountHook) PreApply( h.Lock() defer h.Unlock() + if d.Empty() { + return terraform.HookActionContinue, nil + } + if h.pending == nil { h.pending = make(map[string]countHookAction) }