Browse Source

Prevent panic in serv.go with Deploy Keys (#17434)

Unfortunately there was a regression in #17373 which missed that the user is not
for deploy keys. This leads to a panic when pushing with deploy keys.

Fix #17412

Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.16.0-rc1
zeripath 2 years ago
parent
commit
849356deaf
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      routers/private/serv.go

+ 1
- 1
routers/private/serv.go View File

@@ -283,7 +283,7 @@ func ServCommand(ctx *context.PrivateContext) {
(mode > models.AccessModeRead ||
repo.IsPrivate ||
owner.Visibility.IsPrivate() ||
user.IsRestricted ||
(user != nil && user.IsRestricted) || // user will be nil if the key is a deploykey
setting.Service.RequireSignInView) {
if key.Type == models.KeyTypeDeploy {
if deployKey.Mode < mode {

Loading…
Cancel
Save