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 panic when fields of Failures are nil #72

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

kofuk
Copy link
Contributor

@kofuk kofuk commented Aug 6, 2024

Reason and Arn which are referenced when RunTask failed can be nil.
This fixes panic raised when these fields are nil.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc191d1]
goroutine 513097 [running]:
github.com/acidlemon/mirage-ecs/v2.(*ECS).launchTask(0xc0000a19b0, {0xf01750, 0xc0000bc230}, {0xc00182b500, 0x21}, {0xc001372660, 0x52}, 0xc00045dc20?)
	/stash/src/github.com/acidlemon/mirage-ecs/ecs.go:231 +0x971
github.com/acidlemon/mirage-ecs/v2.(*ECS).Launch.func1()
	/stash/src/github.com/acidlemon/mirage-ecs/ecs.go:256 +0x33
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/stash/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 416582

@kofuk
Copy link
Contributor Author

kofuk commented Aug 25, 2024

@fujiwara
Could you take a look?

@fujiwara
Copy link
Collaborator

@kofuk I'm sorry it's too late. Thank you!

@fujiwara fujiwara merged commit 38b0e1d into acidlemon:v2 Aug 26, 2024
2 checks passed
@kofuk kofuk deleted the avoid-panic branch August 26, 2024 05:23
@kofuk
Copy link
Contributor Author

kofuk commented Aug 26, 2024

Thank you very much!

@fujiwara
Copy link
Collaborator

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