Skip to content

Commit

Permalink
[core] fix nil task access
Browse files Browse the repository at this point in the history
Fixes nil access issue introduced by myself in AliceO2Group#647
  • Loading branch information
knopers8 committed Jan 24, 2025
1 parent 0fe8c3f commit ec8a682
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/task/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,11 +953,13 @@ func (m *Manager) GetTask(id string) *Task {

func (m *Manager) updateTaskState(taskId string, state string) {
taskPtr := m.roster.getByTaskId(taskId)
if taskPtr == nil && state != "DONE" {
log.WithField("taskId", taskId).
WithField("state", state).
WithField(infologger.Level, infologger.IL_Support).
Warn("attempted state update of task not in roster")
if taskPtr == nil {
if state != "DONE" {
log.WithField("taskId", taskId).
WithField("state", state).
WithField(infologger.Level, infologger.IL_Support).
Warn("attempted state update of task not in roster")
}
return
}

Expand Down

0 comments on commit ec8a682

Please sign in to comment.