Skip to content

Commit

Permalink
Fix 500 error viewing pull request when fork has pull requests disabled
Browse files Browse the repository at this point in the history
Fixes #20826
  • Loading branch information
brechtvl committed Jan 18, 2023
1 parent 7ddc11d commit 47adf76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/pull/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest,
return false, false, err
}
prUnit, err := pr.BaseRepo.GetUnit(ctx, unit.TypePullRequests)
if repo_model.IsErrUnitTypeNotExist(err) {
return false, false, nil
}
if err != nil {
log.Error("pr.BaseRepo.GetUnit(unit.TypePullRequests): %v", err)
return false, false, err
Expand Down

0 comments on commit 47adf76

Please sign in to comment.