command/apply: add additional nil check to loading state for outputs

This commit is contained in:
Mitchell Hashimoto 2016-11-02 22:33:34 -07:00
parent 83e3fa2a33
commit 6c801d0386
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A

View File

@ -430,7 +430,12 @@ func outputsAsString(state *terraform.State, modPath []string, schema []*config.
return ""
}
outputs := state.ModuleByPath(modPath).Outputs
ms := state.ModuleByPath(modPath)
if ms == nil {
return ""
}
outputs := ms.Outputs
outputBuf := new(bytes.Buffer)
if len(outputs) > 0 {
schemaMap := make(map[string]*config.Output)