Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8eb9fba

Browse filesBrowse files
committed
Allow pullRequest.getHead().getRepository().getCommit(headSha1) to work
The wrong .wrap method was used for pull requests initialized by state (GHRepository.getPullReqests). The wrong wrap call was introduced in 9fd34ae This commit sets it back to the .wrapUp method which makes sure the pull request substructure has the repo object set properly. Without this change a NullPointerException is thrown on the last line of this code because the repo object inside of the remoteRepository object is null: GHRepository repo = github.getRepository(targetRepository); List<GHPullRequest> openPullRequests = repo.getPullRequests(GHIssueState.OPEN); for (GHPullRequest pullRequest : openPullRequests) { GHCommitPointer head = pullRequest.getHead(); GHRepository remoteRepository = head.getRepository(); String commitId = head.getSha(); GHCommit headCommit = remoteRepository.getCommit(commitId);
1 parent 95fbf92 commit 8eb9fba
Copy full SHA for 8eb9fba

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎src/main/java/org/kohsuke/github/GHRepository.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public PagedIterator<GHPullRequest> iterator() {
514514
@Override
515515
protected void wrapUp(GHPullRequest[] page) {
516516
for (GHPullRequest pr : page)
517-
pr.wrap(GHRepository.this);
517+
pr.wrapUp(GHRepository.this);
518518
}
519519
};
520520
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.