Commit f9ee181
committed
fix(custom-property): return error for empty property_value instead of panicking
resource_github_repository_custom_property.go:72 unconditionally
dereferenced propertyValue[0] for scalar property_type values
(string, single_select, url, true_false). Terraform configurations
that supplied property_value as an empty list — or where a computed
value resolved to empty at apply time — crashed the provider with:
panic: runtime error: index out of range [0] with length 0
resourceGithubRepositoryCustomPropertyCreate ... +0x698
OpenTofu / Terraform recovers from this as a plugin crash, leaves
dangling resource state, and reports it as an internal provider
error rather than a user-facing configuration error.
Guard the index with an explicit length check that returns a clear
Terraform error naming the offending property_type. Multi_select is
unaffected — an empty slice there is intentionally allowed.
Refs integrations/terraform-provider-github issue 3358.1 parent 18178b1 commit f9ee181
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
0 commit comments