Skip to content

Commit

Permalink
修复httputils空指针异常
Browse files Browse the repository at this point in the history
  • Loading branch information
gdy666 committed Jul 31, 2022
1 parent cfadce3 commit 6a2774b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thirdlib/gdylib/httputils/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func GetAndParseJSONResponseFromHttpResponse(resp *http.Response, result interfa

//GetStringFromHttpResponse 从response获取
func GetBytesFromHttpResponse(resp *http.Response) ([]byte, error) {
if resp.Body == nil {
return []byte{}, nil
if resp == nil || resp.Body == nil {
return []byte{}, fmt.Errorf("resp.Body = nil")
}
defer resp.Body.Close()
var body []byte
Expand Down

0 comments on commit 6a2774b

Please sign in to comment.