From 0617bb85c6958da42c6bfc6cc9d3e92c3622d4b8 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 24 Oct 2017 13:01:18 -0700 Subject: [PATCH] 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 --- android/module.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/module.go b/android/module.go index 4d4462b3b..1cdc2dd8b 100644 --- a/android/module.go +++ b/android/module.go @@ -982,6 +982,10 @@ func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string 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 {