Skip to content

Commit

Permalink
Prevent panic in serv.go with Deploy Keys (go-gitea#17434)
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 authored and Stelios Malathouras committed Mar 28, 2022
1 parent d6cf87a commit 66a032d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/private/serv.go
Original file line number Diff line number Diff line change
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 66a032d

Please sign in to comment.