Skip to content

Commit

Permalink
Fix crash caused by nil value in BigQuery Table (#10319)
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick authored Mar 28, 2024
1 parent b256de4 commit bfe6e93
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 bfe6e93

Please sign in to comment.