Commit e024e5f
Reject a nil config in New instead of panicking
New dereferenced config.RepoMap without checking the config pointer, so
New(nil) panicked. NewConfig returns a nil config alongside its error, so a
caller that ignores the error reaches this path.
Also move client construction after validation, so the invalid-input paths
no longer allocate a client they immediately discard.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>1 parent 0fb8e4b commit e024e5f
2 files changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 125 | + | |
| 126 | + | |
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
| |||
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
0 commit comments