Check whether value_variables are set
If value variable had not been set by a user, previously we would error
out. Now, we just skip it.
Test: go test soong tests
Test: m nothing
Change-Id: Ibab67e00b28055b5feee2f4fd79bf4dfb2fc6704
diff --git a/android/soongconfig/modules.go b/android/soongconfig/modules.go
index 5a6917e..9f3f804 100644
--- a/android/soongconfig/modules.go
+++ b/android/soongconfig/modules.go
@@ -541,12 +541,15 @@
}
func (s *valueVariable) PropertiesToApply(config SoongConfig, values reflect.Value) (interface{}, error) {
- if !config.IsSet(s.variable) {
+ if !config.IsSet(s.variable) || !values.IsValid() {
return nil, nil
}
configValue := config.String(s.variable)
propStruct := values.Elem().Elem()
+ if !propStruct.IsValid() {
+ return nil, nil
+ }
for i := 0; i < propStruct.NumField(); i++ {
field := propStruct.Field(i)
kind := field.Kind()