Handle nil enabled values
If enabled does not appear inside `soong_config_vars`, we can ignore it.
Bug: 210546943
Test: go test ./bp2build
Change-Id: I9e4d51c3b683f262921449634f827915ce87dc8d
diff --git a/android/module.go b/android/module.go
index 0120a54..a662130 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1434,7 +1434,10 @@
ctx.ModuleErrorf("Could not convert product variable enabled property")
}
- if *flag {
+ if flag == nil {
+ // soong config var is not used to set `enabled`. nothing to do.
+ continue
+ } else if *flag {
axis := productConfigProp.ConfigurationAxis()
result.SetSelectValue(axis, bazel.ConditionsDefaultConfigKey, bazel.MakeLabelList([]bazel.Label{{Label: "@platforms//:incompatible"}}))
result.SetSelectValue(axis, productConfigProp.SelectKey(), bazel.LabelList{Includes: []bazel.Label{}})