Skip to content

Commit

Permalink
distsql: fix panic on selectResultRuntimeStats.String (#19277)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycs520 committed Sep 3, 2020
1 parent 714a7e8 commit 8135141
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distsql/select_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ func (s *selectResultRuntimeStats) String() string {
}
}
copRPC := s.rpcStat.Stats[tikvrpc.CmdCop]
delete(s.rpcStat.Stats, tikvrpc.CmdCop)
if copRPC.Count > 0 {
if copRPC != nil && copRPC.Count > 0 {
delete(s.rpcStat.Stats, tikvrpc.CmdCop)
buf.WriteString(", rpc_num: ")
buf.WriteString(strconv.FormatInt(copRPC.Count, 10))
buf.WriteString(", rpc_time: ")
Expand Down

0 comments on commit 8135141

Please sign in to comment.