From b60b09aac3b84b615c9f4f645020b24a6e26ca39 Mon Sep 17 00:00:00 2001 From: palmobar <95422414+palmobar@users.noreply.github.com> Date: Fri, 24 Jun 2022 12:10:53 +0200 Subject: [PATCH] Avoid SIGSEGV in map.go when configs[parentConfig].Module.ModuleCalls[something] is nil. --- map.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map.go b/map.go index 5454ecb..3bb3ba0 100644 --- a/map.go +++ b/map.go @@ -246,7 +246,7 @@ func (r *rover) GenerateModuleMap(parent *Resource, parentModule string) { } else if rs.Type == ResourceTypeModule { re.Name = strings.Split(id, ".")[len(strings.Split(id, "."))-1] - if configured && !childIndex.MatchString(id) { + if configured && !childIndex.MatchString(id) && configs[parentConfig].Module.ModuleCalls[matchBrackets.ReplaceAllString(re.Name, "")] != nil { fname := filepath.Base(configs[parentConfig].Module.ModuleCalls[matchBrackets.ReplaceAllString(re.Name, "")].Pos.Filename) re.Line = &configs[parentConfig].Module.ModuleCalls[matchBrackets.ReplaceAllString(re.Name, "")].Pos.Line