Fix empty TypeList expands in generated resources (#2233)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2018-10-11 12:57:31 -07:00 committed by Riley Karson
parent 3f40d2547a
commit 66c10d2ce1
10 changed files with 23 additions and 23 deletions

View File

@ -317,7 +317,7 @@ func expandBinaryAuthorizationAttestorDescription(v interface{}, d *schema.Resou
func expandBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -503,7 +503,7 @@ func expandBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(v inter
func expandBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -538,7 +538,7 @@ func expandComputeAutoscalerDescription(v interface{}, d *schema.ResourceData, c
func expandComputeAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -604,7 +604,7 @@ func expandComputeAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *sc
func expandComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -675,7 +675,7 @@ func expandComputeAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema
func expandComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -1040,7 +1040,7 @@ func expandComputeDiskZone(v interface{}, d *schema.ResourceData, config *Config
func expandComputeDiskSourceImageEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -1101,7 +1101,7 @@ func expandComputeDiskSnapshot(v interface{}, d *schema.ResourceData, config *Co
func expandComputeDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -774,7 +774,7 @@ func expandComputeHealthCheckUnhealthyThreshold(v interface{}, d *schema.Resourc
func expandComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -830,7 +830,7 @@ func expandComputeHealthCheckHttpHealthCheckProxyHeader(v interface{}, d *schema
func expandComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -886,7 +886,7 @@ func expandComputeHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d *schem
func expandComputeHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -942,7 +942,7 @@ func expandComputeHealthCheckTcpHealthCheckProxyHeader(v interface{}, d *schema.
func expandComputeHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -534,7 +534,7 @@ func expandComputeRegionAutoscalerDescription(v interface{}, d *schema.ResourceD
func expandComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -600,7 +600,7 @@ func expandComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(v interface{},
func expandComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -671,7 +671,7 @@ func expandComputeRegionAutoscalerAutoscalingPolicyMetricType(v interface{}, d *
func expandComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -733,7 +733,7 @@ func expandComputeRegionDiskRegion(v interface{}, d *schema.ResourceData, config
func expandComputeRegionDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -775,7 +775,7 @@ func expandComputeRegionDiskSnapshot(v interface{}, d *schema.ResourceData, conf
func expandComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -491,7 +491,7 @@ func expandComputeRouterNetwork(v interface{}, d *schema.ResourceData, config *C
func expandComputeRouterBgp(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -257,7 +257,7 @@ func expandContainerAnalysisNoteName(v interface{}, d *schema.ResourceData, conf
func expandContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -276,7 +276,7 @@ func expandContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.Re
func expandContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]

View File

@ -849,7 +849,7 @@ func expandMonitoringAlertPolicyConditions(v interface{}, d *schema.ResourceData
func expandMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -948,7 +948,7 @@ func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeries
func expandMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -994,7 +994,7 @@ func expandMonitoringAlertPolicyConditionsName(v interface{}, d *schema.Resource
func expandMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
@ -1137,7 +1137,7 @@ func expandMonitoringAlertPolicyConditionsConditionThresholdComparison(v interfa
func expandMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]