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
diff --git a/apex/apex.go b/apex/apex.go
index 67b1f27..c714771 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -450,7 +450,11 @@
}
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 {