Don't panic for unhandled product vars
Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing
Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
diff --git a/android/module.go b/android/module.go
index e6e5918..f4b51ea 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1458,7 +1458,10 @@
// Returns a list of the constraint_value targets who enable this override.
func productVariableConfigEnableAttribute(ctx *topDownMutatorContext) bazel.LabelListAttribute {
result := bazel.LabelListAttribute{}
- productVariableProps := ProductVariableProperties(ctx, ctx.Module())
+ productVariableProps, errs := ProductVariableProperties(ctx, ctx.Module())
+ for _, err := range errs {
+ ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
+ }
if productConfigProps, exists := productVariableProps["Enabled"]; exists {
for productConfigProp, prop := range productConfigProps {
flag, ok := prop.(*bool)