From caa0e1e341e55eb62f163fb01d8fc4c44d36eb8b Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 2 Apr 2019 13:03:46 -0700 Subject: [PATCH] Fix panic when missing hiddenapi jar Fix a panic after reporting an error when a module is listed in ProductHiddenAPIStubs but doesn't exist or doesn't produce a dex jar. Test: manual Change-Id: I43643cbc5303536bfe0b02feedb03563ea0b540a --- java/hiddenapi_singleton.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go index 139114b37..9627dc64b 100644 --- a/java/hiddenapi_singleton.go +++ b/java/hiddenapi_singleton.go @@ -159,9 +159,9 @@ func stubFlagsRule(ctx android.SingletonContext) { for moduleList, pathList := range moduleListToPathList { for i := range pathList { if pathList[i] == nil { + pathList[i] = android.PathForOutput(ctx, "missing") if ctx.Config().AllowMissingDependencies() { missingDeps = append(missingDeps, (*moduleList)[i]) - pathList[i] = android.PathForOutput(ctx, "missing") } else { ctx.Errorf("failed to find dex jar path for module %q", (*moduleList)[i])