Fix missing source module with ALLOW_MISSING_DEPENDENCIES=true
A module referenced with srcs: ":module" was not honoring
ALLOW_MISSING_DEPENDENCIES=true. Don't fail if the module
doesn't exist, an error will already have been produced by
ExtractSourcesDeps.
Bug: 68183622
Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Id806633d12ab2ecd78b532e1922e59824e5c20a8
diff --git a/android/module.go b/android/module.go
index 4d4462b..1cdc2dd 100644
--- a/android/module.go
+++ b/android/module.go
@@ -982,6 +982,10 @@
for _, s := range srcFiles {
if m := SrcIsModule(s); m != "" {
module := ctx.GetDirectDepWithTag(m, SourceDepTag)
+ if module == nil {
+ // Error will have been handled by ExtractSourcesDeps
+ continue
+ }
if srcProducer, ok := module.(SourceFileProducer); ok {
expandedSrcFiles = append(expandedSrcFiles, srcProducer.Srcs()...)
} else {