Skip to content

Commit

Permalink
Fix crash caused by nil value in BigQuery Table (GoogleCloudPlatform#…
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick authored and Cheriit committed Jun 4, 2024
1 parent 7fdace2 commit ab92338
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2355,6 +2355,11 @@ func expandPrimaryKey(configured interface{}) *bigquery.TableConstraintsPrimaryK

columns := []string{}
for _, rawColumn := range raw["columns"].([]interface{}) {
if rawColumn == nil {
// Terraform reads "" as nil, which ends up crashing when we cast below
// sending "" to the API triggers a 400, which is okay.
rawColumn = ""
}
columns = append(columns, rawColumn.(string))
}
if len(columns) > 0 {
Expand Down

0 comments on commit ab92338

Please sign in to comment.