Explorar el Código

Fix nil pointer panic when exec some gitea cli command (#28791) (#28795)

Backport #28791 by @yp05327

panic:

![image](https://github.com/go-gitea/gitea/assets/18380374/7fcde2ad-1d42-4b60-b120-3b60a8926e8e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/49d9f0ca-e590-4a35-8ca2-1317d1b7c939)

Co-authored-by: yp05327 <576951401@qq.com>
tags/v1.21.4
Giteabot hace 4 meses
padre
commit
df694f6a7d
No account linked to committer's email address
Se han modificado 3 ficheros con 9 adiciones y 0 borrados
  1. 3
    0
      modules/private/actions.go
  2. 3
    0
      modules/private/key.go
  3. 3
    0
      modules/private/mail.go

+ 3
- 0
modules/private/actions.go Ver fichero

@@ -22,5 +22,8 @@ func GenerateActionsRunnerToken(ctx context.Context, scope string) (string, Resp
})

resp, extra := requestJSONResp(req, &responseText{})
if resp == nil {
return "", extra
}
return resp.Text, extra
}

+ 3
- 0
modules/private/key.go Ver fichero

@@ -27,5 +27,8 @@ func AuthorizedPublicKeyByContent(ctx context.Context, content string) (string,
req := newInternalRequest(ctx, reqURL, "POST")
req.Param("content", content)
resp, extra := requestJSONResp(req, &responseText{})
if resp == nil {
return "", extra
}
return resp.Text, extra
}

+ 3
- 0
modules/private/mail.go Ver fichero

@@ -30,5 +30,8 @@ func SendEmail(ctx context.Context, subject, message string, to []string) (strin
})

resp, extra := requestJSONResp(req, &responseText{})
if resp == nil {
return "", extra
}
return resp.Text, extra
}

Cargando…
Cancelar
Guardar