Commit 9d80cc6
committed
fix: move None guard above yaml.dump to avoid writing null to debug file
## What
Moved the `if dependabot_file is None` check above the `yaml.dump()` call in `main()` so that None results skip immediately without writing `null` to `dependabot-output.yaml`.
## Why
The previous ordering called `yaml.dump(None, yaml_file)` before checking for None, writing a `null` YAML literal to the debug artifact. This was a pre-existing issue for the "no package managers" path, but the YAML error handling change made it newly reachable via the error path.
## Notes
- The YAML object and stream setup also moved below the guard since they're only needed when dependabot_file is not None.
Signed-off-by: jmeridth <jmeridth@gmail.com>1 parent 421659e commit 9d80cc6
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
| |||
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
0 commit comments