Merge "Check whether value_variables are set"

This commit is contained in:
Liz Kammer
2021-01-05 17:42:11 +00:00
committed by Gerrit Code Review

View File

@@ -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) {
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()