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

Don't crash when a file disappears #236

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erikdubbelboer
Copy link

When a file disappears during filepath.Walk it will set err and info will be nil. If we continue our normal processing realize crashes with the following panic:

stat /go/src/github.com/erikdubbelboer/test/test.go: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x82da1a]

goroutine 1285 [running]:
github.com/oxequa/realize/realize.(*Project).tools.func1(0x91a620, 0xc000129400, 0x99, 0xc000090a00, 0x0, 0x0, 0xc0003e64e0, 0xc0001e6210, 0xc0002761e0, 0xc0003e6480)
	/go/src/github.com/oxequa/realize/realize/projects.go:420 +0x1da
created by github.com/oxequa/realize/realize.(*Project).tools
	/go/src/github.com/oxequa/realize/realize/projects.go:415 +0x1fd

When a file disappears during filepath.Walk it will set err and info
will be nil. If we continue our normal processing realize crashes with
the following panic:

stat /go/src/github.com/erikdubbelboer/test/test.go: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x82da1a]

goroutine 1285 [running]:
github.com/oxequa/realize/realize.(*Project).tools.func1(0x91a620, 0xc000129400, 0x99, 0xc000090a00, 0x0, 0x0, 0xc0003e64e0, 0xc0001e6210, 0xc0002761e0, 0xc0003e6480)
	/go/src/github.com/oxequa/realize/realize/projects.go:420 +0x1da
created by github.com/oxequa/realize/realize.(*Project).tools
	/go/src/github.com/oxequa/realize/realize/projects.go:415 +0x1fd
@cameracker
Copy link

Can we get this merged in? As it stands now this tool is barely usable because anytime a branch is switched it crashes.

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