Don't crash when a file disappears#236
Open
erikdubbelboer wants to merge 1 commit intooxequa:masterfrom
Open
Conversation
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
|
Can we get this merged in? As it stands now this tool is barely usable because anytime a branch is switched it crashes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a file disappears during
filepath.Walkit will seterrandinfowill benil. If we continue our normal processing realize crashes with the following panic: