check for error earlier in matchingWalker.Walk to avoid nil deref#3179
check for error earlier in matchingWalker.Walk to avoid nil deref#3179
Conversation
marcosnav
left a comment
There was a problem hiding this comment.
Moving up the error checking is a good move, although not sure this is the complete solution.
I tried this out and a dir with permissions 600 that is selected in the files tree is still included in the bundle as an empty dir.
There's a UX problem here too. If there are files in the configuration file for which the directory permissions change, it is not possible to de-select from the files tree since the dir won't expand. This is a very contrived issue and maybe not worth solving the UX side of it, specially if we manage to not include the directory on the deployment, which sounds like a good enough solution.
|
I'm going to close this PR up as a stale. We can re-open if we want to take another attempt at it. |
Intent
Related to #3180.
When deploying in this situation, it results in an internal server error due to a nil pointer dereference. We're not checking the error we get from walking the filesystem soon enough.
Type of Change
Approach
Moved the error handling up so it can catch this case.
User Impact
Users won't hit an internal server error in this case; the filesystem walk will complete successfully and an error will be logged about the file that caused an error.
Automated Tests
Added a test to verify this case.
Directions for Reviewers
Use steps in linked ticket and hit deploy.
Checklist