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

azurerm_logic_app_workflow: fix crash when access_control is empty block #22486

Merged
merged 2 commits into from
Jul 13, 2023

Conversation

ziyeqf
Copy link
Contributor

@ziyeqf ziyeqf commented Jul 12, 2023

fix #22474

Signed-off-by: ziyeqf <51212351+ziyeqf@users.noreply.github.com>
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @ziyeqf, thanks for getting these crash checks in! One of the checks isn't necessary though and I detailed what we should check in the review

@@ -869,7 +869,7 @@ func expandLogicAppWorkflowIPAddressRanges(input []interface{}) *[]workflows.IPA
}

func expandLogicAppWorkflowOpenAuthenticationPolicy(input []interface{}) *map[string]workflows.OpenAuthenticationAccessPolicy {
if len(input) == 0 {
if len(input) == 0 || input[0] == nil {
Copy link
Member

Choose a reason for hiding this comment

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

This check isn't needed here as we're going over the range of the slice just a few lines down. Instead we want to check that item isn't nil before we cast to it

Signed-off-by: ziyeqf <51212351+ziyeqf@users.noreply.github.com>
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for those changes @ziyeqf

@mbfrahry mbfrahry added this to the v3.65.0 milestone Jul 13, 2023
@mbfrahry mbfrahry changed the title azurerm_logic_app_workflow : fix crash when access_control is empty block azurerm_logic_app_workflow: fix crash when access_control is empty block Jul 13, 2023
@mbfrahry mbfrahry merged commit b9345f0 into hashicorp:main Jul 13, 2023
21 checks passed
mbfrahry added a commit that referenced this pull request Jul 13, 2023
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azurerm_logic_app_workflow access_control block plugin crashed
2 participants