aboutsummaryrefslogtreecommitdiffstats
path: root/models/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/pull.go')
-rw-r--r--models/pull.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/pull.go b/models/pull.go
index d059081a44..71a2439b2c 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -299,6 +299,10 @@ func (pr *PullRequest) GetLastCommitStatus() (status *CommitStatus, err error) {
return nil, err
}
+ if pr.HeadRepo == nil {
+ return nil, ErrPullRequestHeadRepoMissing{pr.ID, pr.HeadRepoID}
+ }
+
headGitRepo, err := git.OpenRepository(pr.HeadRepo.RepoPath())
if err != nil {
return nil, err