Merge "Initialize TaggedOutputFiles before updating it" into main

This commit is contained in:
Zi Wang 2024-06-06 21:54:15 +00:00 committed by Gerrit Code Review
commit aff9a2c7ac

View file

@ -718,6 +718,9 @@ func (m *moduleContext) SetOutputFiles(outputFiles Paths, tag string) {
}
m.module.base().outputFiles.DefaultOutputFiles = outputFiles
} else {
if m.module.base().outputFiles.TaggedOutputFiles == nil {
m.module.base().outputFiles.TaggedOutputFiles = make(map[string]Paths)
}
if _, exists := m.module.base().outputFiles.TaggedOutputFiles[tag]; exists {
m.ModuleErrorf("Module %s OutputFiles at tag %s cannot be overwritten", m.ModuleName(), tag)
} else {