Commit 2b558c4
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 3bd6225 commit 2b558c4
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
181 | 185 | | |
182 | 186 | | |
183 | 187 | | |
| |||
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
0 commit comments