mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 03:21:49 +01:00
Fix 500 error viewing pull request when fork has pull requests disabled (#22512)
Swallow error just like in #20839, for the case where there is no protected branch. Fixes #20826 for me, though I can't tell if this now covers all cases.
This commit is contained in:
parent
4804900ac9
commit
aa87b36900
1 changed files with 3 additions and 0 deletions
|
@ -118,6 +118,9 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest,
|
||||||
}
|
}
|
||||||
prUnit, err := pr.BaseRepo.GetUnit(ctx, unit.TypePullRequests)
|
prUnit, err := pr.BaseRepo.GetUnit(ctx, unit.TypePullRequests)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if repo_model.IsErrUnitTypeNotExist(err) {
|
||||||
|
return false, false, nil
|
||||||
|
}
|
||||||
log.Error("pr.BaseRepo.GetUnit(unit.TypePullRequests): %v", err)
|
log.Error("pr.BaseRepo.GetUnit(unit.TypePullRequests): %v", err)
|
||||||
return false, false, err
|
return false, false, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue