-
Notifications
You must be signed in to change notification settings - Fork 356
Fixing NullPointerExceptions in PullRequests #245
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
Conversation
Thanks for resubmitting this PR 😊 |
link to see current commit author: https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/245/commits/710faec6e6072648bc641618ca1908bfa40511e1.patch @2improveIT Or look into fixing your git user.email config 😅 to get proper credit for your commits 🏆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide some details in the description under which circumstances you have seen the NPEs occur?
if (branch != null) { | ||
branch.setCommitClosure(new CommitClosure(branch.getRawNode())); | ||
} | ||
} catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really want to catch ALL exceptions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I missed that 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@2improveIT ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adapted the code
branch.setCommitClosure(new CommitClosure(branch.getRawNode())); | ||
} | ||
} catch (Exception e) { | ||
LOGGER.log( Level.SEVERE, "setupClosureForPRBranch", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting could be improved by removing the trailing space after LOGGER.log(
.
LOGGER.log( Level.SEVERE, "setupClosureForPRBranch", e); | |
LOGGER.log(Level.SEVERE, "setupClosureForPRBranch", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adapted the code
710faec
to
32a30d6
Compare
Fixing NullPointerExceptions
Your checklist for this pull request