Skip to content

Commit

Permalink
fix: hashed-worker-manager nil pointer panic (#21887)
Browse files Browse the repository at this point in the history
Co-authored-by: Qiu Jian <[email protected]>
  • Loading branch information
swordqiu and Qiu Jian authored Dec 23, 2024
1 parent 290626c commit 589343e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cloudcommon/db/taskman/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ func registerTaskAndWorkerMan(task interface{}, workerMan interface{}) {
taskType := reflect.Indirect(reflect.ValueOf(task)).Type()
taskTable[taskName] = taskType
// log.Infof("Task %s registerd", taskName)
if workerMan != nil {
if workerMan != nil && !gotypes.IsNil(workerMan) {
taskWorkerMap[taskName] = workerMan
}
}

func RegisterTask(task interface{}) {
RegisterTaskAndWorker(task, nil)
registerTaskAndWorkerMan(task, nil)
}

func isTaskExist(taskName string) bool {
Expand Down

0 comments on commit 589343e

Please sign in to comment.