check for empty diff in CountHook.PreApply

Make sure we don't try to count anything from a nil diff.
This commit is contained in:
James Bardin 2017-05-26 15:04:56 -04:00
parent dbe9599820
commit f8bfc0a80d
1 changed files with 4 additions and 0 deletions

View File

@ -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)
}