Skip to content

Avoid NPE as discussed in #57 #182

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

Merged
merged 2 commits into from
Apr 9, 2015
Merged

Avoid NPE as discussed in #57 #182

merged 2 commits into from
Apr 9, 2015

Conversation

TheSnoozer
Copy link
Collaborator

revWalk.parseCommit will throw a NPE when Argument is null.

Caused by: java.lang.NullPointerException
    at org.eclipse.jgit.lib.ObjectIdOwnerMap.get(ObjectIdOwnerMap.java:131)
    at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:838)
    at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:753)
    at pl.project13.maven.git.JGitProvider.prepareGitToExtractMoreDetailedReproInformation(JGitProvider.java:91)
    ... 26 more

headCommit = revWalk.parseCommit(HEAD.getObjectId());
ObjectId headObjectId = head.getObjectId();
if(headObjectId == null){
throw new MojoExecutionException("Could not get HEAD Ref, are you sure you've some commits in the dotGitDirectory?");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have

@ktoso
Copy link
Collaborator

ktoso commented Apr 9, 2015

Good one, LGTM, I'd reword the msg though :-)

@TheSnoozer
Copy link
Collaborator Author

Changed to "you have". Just copied and pasted from the other message by the way ;)

@ktoso
Copy link
Collaborator

ktoso commented Apr 9, 2015

oh ok, thanks :) let's merge

TheSnoozer pushed a commit that referenced this pull request Apr 9, 2015
Avoid NPE as discussed in #57
@TheSnoozer TheSnoozer merged commit bf4adb6 into git-commit-id:master Apr 9, 2015
@TheSnoozer TheSnoozer added this to the 2.1.14 milestone Apr 12, 2015
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