Skip to content

Commit

Permalink
Avoid SIGSEGV in map.go
Browse files Browse the repository at this point in the history
when configs[parentConfig].Module.ModuleCalls[something] is nil.
  • Loading branch information
palmobar authored Jun 24, 2022
1 parent bac2d1a commit b60b09a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion map.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b60b09a

Please # to comment.