diff --git a/google/resource_binaryauthorization_attestor.go b/google/resource_binaryauthorization_attestor.go index 7a4d02a2..2948b3b9 100644 --- a/google/resource_binaryauthorization_attestor.go +++ b/google/resource_binaryauthorization_attestor.go @@ -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] diff --git a/google/resource_binaryauthorization_policy.go b/google/resource_binaryauthorization_policy.go index 49a5a2e6..fcac616f 100644 --- a/google/resource_binaryauthorization_policy.go +++ b/google/resource_binaryauthorization_policy.go @@ -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] diff --git a/google/resource_compute_autoscaler.go b/google/resource_compute_autoscaler.go index 43f0672a..dac6dddb 100644 --- a/google/resource_compute_autoscaler.go +++ b/google/resource_compute_autoscaler.go @@ -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] diff --git a/google/resource_compute_disk.go b/google/resource_compute_disk.go index 7871b987..63613836 100644 --- a/google/resource_compute_disk.go +++ b/google/resource_compute_disk.go @@ -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] diff --git a/google/resource_compute_health_check.go b/google/resource_compute_health_check.go index bce9037a..ff62218f 100644 --- a/google/resource_compute_health_check.go +++ b/google/resource_compute_health_check.go @@ -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] diff --git a/google/resource_compute_region_autoscaler.go b/google/resource_compute_region_autoscaler.go index 93a14c7f..4be06005 100644 --- a/google/resource_compute_region_autoscaler.go +++ b/google/resource_compute_region_autoscaler.go @@ -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] diff --git a/google/resource_compute_region_disk.go b/google/resource_compute_region_disk.go index 2944e12f..d05f7bdd 100644 --- a/google/resource_compute_region_disk.go +++ b/google/resource_compute_region_disk.go @@ -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] diff --git a/google/resource_compute_router.go b/google/resource_compute_router.go index f043388e..b00dd5cf 100644 --- a/google/resource_compute_router.go +++ b/google/resource_compute_router.go @@ -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] diff --git a/google/resource_containeranalysis_note.go b/google/resource_containeranalysis_note.go index a8738bca..1ca490d3 100644 --- a/google/resource_containeranalysis_note.go +++ b/google/resource_containeranalysis_note.go @@ -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] diff --git a/google/resource_monitoring_alert_policy.go b/google/resource_monitoring_alert_policy.go index cc28792b..c0d2c609 100644 --- a/google/resource_monitoring_alert_policy.go +++ b/google/resource_monitoring_alert_policy.go @@ -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]