diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-04-26 11:03:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 11:03:39 +0800 |
commit | 4c34bc111ce020161a2fbd962a19a9123b3e2dc4 (patch) | |
tree | fd7dae27b71494ae7707644b2368e89d155d3956 /models/pull.go | |
parent | ec2d489d15580ba934f34d8cdf3d779e1d64374d (diff) | |
download | gitea-4c34bc111ce020161a2fbd962a19a9123b3e2dc4.tar.gz gitea-4c34bc111ce020161a2fbd962a19a9123b3e2dc4.zip |
fix pulls broken when fork repository deleted (#6754)
* fix pulls broken when fork repository deleted
* fix lint
Diffstat (limited to 'models/pull.go')
-rw-r--r-- | models/pull.go | 4 |
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 |