Merge "Check `base` property before using it"

This commit is contained in:
Jooyung Han 2020-06-25 03:13:16 +00:00 committed by Gerrit Code Review
commit 83f107cdfb
1 changed files with 5 additions and 0 deletions

View File

@ -223,6 +223,11 @@ var overrideBaseDepTag overrideBaseDependencyTag
// next phase.
func overrideModuleDepsMutator(ctx BottomUpMutatorContext) {
if module, ok := ctx.Module().(OverrideModule); ok {
base := String(module.getOverrideModuleProperties().Base)
if !ctx.OtherModuleExists(base) {
ctx.PropertyErrorf("base", "%q is not a valid module name", base)
return
}
// See if there's a prebuilt module that overrides this override module with prefer flag,
// in which case we call SkipInstall on the corresponding variant later.
ctx.VisitDirectDepsWithTag(PrebuiltDepTag, func(dep Module) {