Commit efee7d5
committed
Fix TypeError crash in fetch_vulnerabilities when VulnerableCode is unreachable
bulk_search_by_purl() returns None when request_post() catches a network error or HTTP failure. The loop in fetch_vulnerabilities() iterated over
the result directly, crashing with TypeError: 'NoneType' is not iterable.
Add a guard that skips the batch and logs a warning when response_data
is falsy, so a VulnerableCode outage degrades gracefully instead of
aborting the entire pipeline run.
Fixes #2107
Signed-off-by: Harsh Verma <harshkardam246@gmail.com>1 parent 2090ea0 commit efee7d5
2 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
226 | 232 | | |
227 | 233 | | |
228 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
| |||
0 commit comments