Skip to content

Commit 63e5db5

Browse files
jolheiserbrechtvl
andauthored
Fix 500 error viewing pull request when fork has pull requests disabled (#22512) (#22515)
Backport #22512 Co-authored-by: Brecht Van Lommel <[email protected]>
1 parent e6e2c2f commit 63e5db5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/pull/update.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest,
109109
if pr.ProtectedBranch == nil {
110110
prUnit, err := pr.BaseRepo.GetUnit(unit.TypePullRequests)
111111
if err != nil {
112+
if repo_model.IsErrUnitTypeNotExist(err) {
113+
return false, false, nil
114+
}
112115
log.Error("pr.BaseRepo.GetUnit(unit.TypePullRequests): %v", err)
113116
return false, false, err
114117
}

0 commit comments

Comments
 (0)