diff --git a/modules/private/actions.go b/modules/private/actions.go index c924dac2c..4ec77dc93 100644 --- a/modules/private/actions.go +++ b/modules/private/actions.go @@ -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 } diff --git a/modules/private/key.go b/modules/private/key.go index 6f7cd8779..aa1e8aa56 100644 --- a/modules/private/key.go +++ b/modules/private/key.go @@ -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 } diff --git a/modules/private/mail.go b/modules/private/mail.go index 82216b346..699f5e5f4 100644 --- a/modules/private/mail.go +++ b/modules/private/mail.go @@ -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 }