Skip to content

Commit

Permalink
Fix nil skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Feb 15, 2024
1 parent c915a40 commit ea20f85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions upup/pkg/fi/topological_sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ func FindTaskDependencies[T SubContext](tasks map[string]Task[T]) map[string][]s

var dependencyKeys []string
for _, dep := range dependencies {
if dep == nil {
// Skip nils, including interface nils
if dep == nil || reflect.ValueOf(dep).IsNil() {
continue
}
dependencyKey, found := taskToId[dep]
if !found {
klog.Fatalf("dependency not found: %v", dep)
klog.Fatalf("dependency for task %T:%q not found: %v", t, k, dep)
}
dependencyKeys = append(dependencyKeys, dependencyKey)
}
Expand Down

0 comments on commit ea20f85

Please sign in to comment.