Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type conversion bug #223

Merged
merged 1 commit into from
Sep 30, 2020
Merged

Fix type conversion bug #223

merged 1 commit into from
Sep 30, 2020

Conversation

koikonom
Copy link
Contributor

Description

While iterating over a trigger prefix list sometimes items can be nil.
We are now checking if conversion is possible instead of "blindly"
converting them and potentially causing a crash.

While iterating over a trigger prefix list sometimes items can be nil.
We are now checking if conversion is possible instead of "blindly"
converting them and potentially causing a crash.
@ghost ghost added the size/XS label Sep 23, 2020
@koikonom koikonom marked this pull request as ready for review September 23, 2020 15:37
@koikonom
Copy link
Contributor Author

Closes #183 .

Copy link
Contributor

@lafentres lafentres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me! tested it locally with this config and compared before/after:

resource "tfe_workspace" "test-workspace" {
  name = "test-workspace"
  organization = tfe_organization.test-org.name
  trigger_prefixes = ["", "test"]
}

it seems like the previous code was assuming that the elements of trigger_prefixes were never just empty strings. it might make sense to add some sort of validation for each element eventually, that way people get a warning that they've provided an improper trigger prefix.

@koikonom koikonom merged commit 36c9caf into master Sep 30, 2020
@chrisarcand chrisarcand deleted the gh183_fix_crash branch December 2, 2020 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants