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: avoid panic when calculating label for block #2997

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

tim775
Copy link
Member

@tim775 tim775 commented Apr 2, 2024

I wasn't able to reproduce but we got a runtime error: invalid memory address or nil pointer dereference.

Stack trace is:

   /panic.go:770                                    panic()
   internal/hcl/block.go:1276                       (*Block).Label()
   internal/providers/terraform/hcl_provider.go:412 (*HCLProvider).marshalModule.func1()
   sort/zsortfunc.go:12                             insertionSort_func()
   sort/zsortfunc.go:343                            stable_func()
   sort/slice.go:44                                 SliceStable()
   internal/providers/terraform/hcl_provider.go:411 (*HCLProvider).marshalModule()
   internal/providers/terraform/hcl_provider.go:440 (*HCLProvider).marshalModule()
   internal/providers/terraform/hcl_provider.go:440 (*HCLProvider).marshalModule()
   internal/providers/terraform/hcl_provider.go:440 (*HCLProvider).marshalModule()
   internal/providers/terraform/hcl_provider.go:440 (*HCLProvider).marshalModule()
   internal/providers/terraform/hcl_provider.go:440 (*HCLProvider).marshalModule()
   internal/providers/terraform/hcl_provider.go:382 (*HCLProvider).modulesToPlanJSON()
   internal/providers/terraform/hcl_provider.go:302 (*HCLProvider).LoadPlanJSON()
   internal/providers/terraform/hcl_provider.go:215 (*HCLProvider).LoadResources()
   main/run.go:427                                  (*parallelRunner).runProvider()
   main/run.go:282                                  (*parallelRunner).run.func1()
   golang.org/x/sync/errgroup/errgroup.go:75        (*Group).Go.func1()

@tim775 tim775 self-assigned this Apr 2, 2024
@tim775 tim775 requested a review from hugorut April 3, 2024 03:01
@tim775 tim775 merged commit 6b86b18 into master Apr 3, 2024
9 of 10 checks passed
@tim775 tim775 deleted the fix/avoid_panic_on_block_label branch April 3, 2024 12:51
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.

None yet

2 participants