Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit c8e4ab8

Browse files
committed
[login] do not panic on nil response
- this was identified in https://github.com/ParsePlatform/parse-cli/issues/40 we should not be panicing on network errors
1 parent b6c0565 commit c8e4ab8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parsecli/login.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func (l *Login) AuthToken(e *Env, token string) (string, error) {
219219
Email string `json:"email"`
220220
}{}
221221
if response, err := e.ParseAPIClient.Do(req, nil, res); err != nil {
222-
if response.StatusCode == http.StatusUnauthorized {
222+
if response != nil && response.StatusCode == http.StatusUnauthorized {
223223
return "", stackerr.Newf(tokenErrMsgf, Last4(token), keysURL)
224224
}
225225
return "", stackerr.Wrap(err)

0 commit comments

Comments
 (0)