Skip to content

Commit

Permalink
Check bodyBytes before unmarshal
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Nov 22, 2023
1 parent e6bed42 commit fb36395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/domain/infosync/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func pdResponseHandler(resp *http.Response, res interface{}) error {
return err
}
if resp.StatusCode == http.StatusOK {
if res != nil {
if res != nil && bodyBytes != nil {
return json.Unmarshal(bodyBytes, res)
}
return nil
Expand Down

0 comments on commit fb36395

Please sign in to comment.