Skip to content

Commit 78965b9

Browse files
authored
[#392] NPE during polling when one of the PRs has no source repository (#393)
In case when old PR removed it's repository NPE may occur here
1 parent 20e3b61 commit 78965b9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github-pullrequest-plugin/src/main/java/org/jenkinsci/plugins/github/pullrequest/GitHubPRPullRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public GitHubPRPullRequest(GHPullRequest pr) {
7373
GHCommitPointer prHead = pr.getHead();
7474
headSha = prHead.getSha();
7575
headRef = prHead.getRef();
76-
sourceRepoOwner = prHead.getRepository().getOwnerName();
76+
sourceRepoOwner = prHead.getRepository() == null ? null : prHead.getRepository().getOwnerName();
7777

7878
title = pr.getTitle();
7979
baseRef = pr.getBase().getRef();

0 commit comments

Comments
 (0)