core: fix panic in TestContext2Apply_resourceDependsOnModuleDestroy

This panic is likely caused by a bug, since "ami" should always be set,
but we'll fix the panic first to allow the tests to run to completion.
This commit is contained in:
Martin Atkins 2018-09-12 17:36:40 -07:00
parent 64eb5f732c
commit 934dd8f710

View File

@ -408,7 +408,7 @@ func TestContext2Apply_resourceDependsOnModuleDestroy(t *testing.T) {
is *InstanceState,
id *InstanceDiff) (*InstanceState, error) {
if id.Attributes["ami"].New == "parent" {
if id.Attributes["ami"] != nil && id.Attributes["ami"].New == "parent" {
checked = true
// Sleep to allow parallel execution