Skip to content

Commit 397400e

Browse files
authored
server: fix nil panic in GetProgressByID and GetProgressByAction (#10527)
close #10526 Signed-off-by: songqing <zhangsongqing164@163.com>
1 parent 5e71b3a commit 397400e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

server/handler.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,20 @@ func (h *Handler) ResetTS(ts uint64, ignoreSmaller, skipUpperBoundCheck bool, _
335335

336336
// GetProgressByID returns the progress details for a given store ID.
337337
func (h *Handler) GetProgressByID(storeID uint64) (*progress.Progress, error) {
338-
return h.s.GetRaftCluster().GetProgressByID(storeID)
338+
c, err := h.GetRaftCluster()
339+
if err != nil {
340+
return nil, err
341+
}
342+
return c.GetProgressByID(storeID)
339343
}
340344

341345
// GetProgressByAction returns the progress details for a given action.
342346
func (h *Handler) GetProgressByAction(action string) (*progress.Progress, error) {
343-
return h.s.GetRaftCluster().GetProgressByAction(action)
347+
c, err := h.GetRaftCluster()
348+
if err != nil {
349+
return nil, err
350+
}
351+
return c.GetProgressByAction(action)
344352
}
345353

346354
// PluginLoad loads the plugin referenced by the pluginPath

0 commit comments

Comments
 (0)