Fix a nill pointer dereference when TARGET_FLATTEN_APEX

When TARGET_FLATTEN_APEX is set to true, there is no single output file
for an APEX that other modules can reference via ":module" syntax.
Return nothing in that case.

Bug: 121221006
Test: TARGET_FLATTEN_APEX=true m
Change-Id: I556b55073720b16fd30fd133af58aac229e958c0
This commit is contained in:
Jiyong Park 2018-12-20 09:54:35 +09:00
parent a044a686c5
commit 5a8320201a
1 changed files with 5 additions and 1 deletions

View File

@ -450,7 +450,11 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (a *apexBundle) Srcs() android.Paths {
return android.Paths{a.outputFiles[imageApex]}
if file, ok := a.outputFiles[imageApex]; ok {
return android.Paths{file}
} else {
return nil
}
}
func (a *apexBundle) installable() bool {