Skip to content

Commit 931965c

Browse files
committed
Prevent panic in serv.go with Deploy Keys
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 <[email protected]>
1 parent 649e1d0 commit 931965c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/private/serv.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func ServCommand(ctx *context.PrivateContext) {
283283
(mode > models.AccessModeRead ||
284284
repo.IsPrivate ||
285285
owner.Visibility.IsPrivate() ||
286-
user.IsRestricted ||
286+
(user != nil && user.IsRestricted) || // user will be nil if the key is a deploykey
287287
setting.Service.RequireSignInView) {
288288
if key.Type == models.KeyTypeDeploy {
289289
if deployKey.Mode < mode {

0 commit comments

Comments
 (0)