Skip to content

Commit 98d08be

Browse files
authored
Merge pull request #3223 from 0x0elliot/master
fix: nil pointer that happened twice in swarm stack. Rare occurrence.
2 parents 9c8dba4 + 8d571f3 commit 98d08be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

manager/orchestrator/service.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ func SetServiceTasksRemove(ctx context.Context, s *store.MemoryStore, service *a
7272
// within the boundaries of a transaction
7373
latestTask := store.GetTask(tx, t.ID)
7474

75+
// in case the task is deleted
76+
if latestTask == nil {
77+
log.G(ctx).WithField("task_id", t.ID).Debug("task no longer exists in store")
78+
return nil
79+
}
80+
7581
// time travel is not allowed. if the current desired state is
7682
// above the one we're trying to go to we can't go backwards.
7783
// we have nothing to do and we should skip to the next task

0 commit comments

Comments
 (0)