-
Notifications
You must be signed in to change notification settings - Fork 467
Null pointer exception due to workingTreeIterator being null for git ignored files. #911
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
Comments
Until this is fixed, the following is a workaround:
|
The workaround does not work in my case, spotless still fails with
Spotless fails with the exception
|
I debugged this and found it was occurring for file |
@nedtwigg Workaround worked for me (and now I'm happily unblocked) but its a pretty unpleasent when its a known bald NullPointer that has to be googled for that eventually leads to this issue. Even just a nice error message would be helpful. |
Hey, thanks for the workaround. I removed 1 file this way, but unfortunately this didn't make the error go away. I'm still getting:
I tried cleaning up the repo via I checked out a clean version of the repo to a separate folder and everything works fine there. So probably the original |
Null pointer exception with git ignored files.
If there is a file that is already committed and later becomes a part of
.gitignore
, this file creates a null pointer exception in spotless when used withratchetFrom
.This happens because
workingTreeIterator
evaluates to null (here) for these files.This is an exceptional case so maybe by adding a null check, we will ignore these files?
Steps to recreate the bug(example repo)
Wow.js
inside a packageuseless
(commit)Wow.java
will always be there as it was already committed and will create problems for spotless when used withratchetFrom
.spotlessCheck
fails with a null pointer exception due to this file. (commit)Technical Details
Gradle 6.1.1
5.12.4
macOS Big Sur 11.2.2
The text was updated successfully, but these errors were encountered: