Skip to content

Commit

Permalink
Prevent panic in serv.go with Deploy Keys
Browse files Browse the repository at this point in the history
Unfortunately there was a regression in go-gitea#17373 which missed that the user is not
for deploy keys. This leads to a panic when pushing with deploy keys.

Fix go-gitea#17412

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Oct 25, 2021
1 parent 649e1d0 commit 931965c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/private/serv.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 931965c

Please sign in to comment.