We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8730ee0 commit e726e4bCopy full SHA for e726e4b
models/pull.go
@@ -113,6 +113,15 @@ func (pr *PullRequest) loadIssue(e Engine) (err error) {
113
114
// LoadProtectedBranch loads the protected branch of the base branch
115
func (pr *PullRequest) LoadProtectedBranch() (err error) {
116
+ if pr.BaseRepo == nil {
117
+ if pr.BaseRepoID == 0 {
118
+ return nil
119
+ }
120
+ pr.BaseRepo, err = GetRepositoryByID(pr.BaseRepoID)
121
+ if err != nil {
122
+ return
123
124
125
pr.ProtectedBranch, err = GetProtectedBranchBy(pr.BaseRepo.ID, pr.BaseBranch)
126
return
127
}
0 commit comments