Commit 547f2c7
authored
fix: guard against nil target entries in bundle debug list-targets (#5203)
## Summary
- `bundle debug list-targets` panics with a nil pointer dereference at
`cmd/bundle/debug/list_targets.go:40` when the targets map contains a
nil `*config.Target`.
- YAML decoding can leave such an entry when a target is declared with a
null value; `collectTargets` then dereferences `t.Default`/`t.Mode`
without a nil check.
- Skip nil entries while still listing the target name so the command no
longer crashes.
## Test plan
- [ ] `./task test` passes.
- [ ] Manual: a `databricks.yml` with a null-valued target lists its
name and exits 0 instead of panicking.1 parent c59058c commit 547f2c7
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
0 commit comments