Skip to content

Commit

Permalink
infoschema: fix the nil pointer (pingcap#53096) (pingcap#53148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored May 10, 2024
1 parent fe1f6ca commit 5216ddb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -1988,15 +1988,15 @@ func getMicroServiceServerInfo(ctx sessionctx.Context, serviceName string) ([]Se
}
req.Header.Add("PD-Allow-follower-handle", "true")
resp, err := util.InternalHTTPClient().Do(req)
if resp == nil || resp.StatusCode != http.StatusOK {
terror.Log(resp.Body.Close())
continue
}
if err != nil {
ctx.GetSessionVars().StmtCtx.AppendWarning(err)
logutil.BgLogger().Warn("request microservice server info error", zap.String("service", serviceName), zap.String("url", url), zap.Error(err))
continue
}
if resp.StatusCode != http.StatusOK {
terror.Log(resp.Body.Close())
continue
}
var content = []struct {
ServiceAddr string `json:"service-addr"`
Version string `json:"version"`
Expand Down

0 comments on commit 5216ddb

Please sign in to comment.