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
This commit is contained in:
@@ -541,12 +541,15 @@ func (s *valueVariable) initializeProperties(v reflect.Value, typ reflect.Type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *valueVariable) PropertiesToApply(config SoongConfig, values reflect.Value) (interface{}, error) {
|
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
|
return nil, nil
|
||||||
}
|
}
|
||||||
configValue := config.String(s.variable)
|
configValue := config.String(s.variable)
|
||||||
|
|
||||||
propStruct := values.Elem().Elem()
|
propStruct := values.Elem().Elem()
|
||||||
|
if !propStruct.IsValid() {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
for i := 0; i < propStruct.NumField(); i++ {
|
for i := 0; i < propStruct.NumField(); i++ {
|
||||||
field := propStruct.Field(i)
|
field := propStruct.Field(i)
|
||||||
kind := field.Kind()
|
kind := field.Kind()
|
||||||
|
Reference in New Issue
Block a user