Skip to content

Fix NoneType error in fetch_vulnerabilities and improve request_post#2094

Closed
rishabh23rohil wants to merge 1 commit into
aboutcode-org:mainfrom
rishabh23rohil:fix-fetch-vulnerabilities-none-handling
Closed

Fix NoneType error in fetch_vulnerabilities and improve request_post#2094
rishabh23rohil wants to merge 1 commit into
aboutcode-org:mainfrom
rishabh23rohil:fix-fetch-vulnerabilities-none-handling

Conversation

@rishabh23rohil

Copy link
Copy Markdown
Contributor

Summary

  • Handle None return from bulk_search_by_purl() in fetch_vulnerabilities(). When VulnerableCode API returns an error, request_post() returns None, which causes TypeError: 'NoneType' object is not iterable when iterated on line 226. Added a guard to skip failed batches gracefully.

  • Add missing docstring to request_post() for consistency with request_get() (line 99).

  • Add debug logging to request_post() matching the logging pattern used in request_get() (line 107).

Test plan

  • Verified that existing tests pass
  • The None guard ensures failed API batches are skipped instead of crashing the pipeline

- Handle None return from bulk_search_by_purl() in fetch_vulnerabilities().
  When VulnerableCode API returns an error, request_post() returns None,
  which causes TypeError when iterated. Added a guard to skip failed batches.

- Add missing docstring to request_post() for consistency with request_get().

- Add debug logging to request_post() matching the pattern used in request_get().

Signed-off-by: Rishabh Rohil <rishabh23rohil@gmail.com>
Signed-off-by: Rishabh Rohil <rishabhrohil024@gmail.com>
@github-actions github-actions Bot closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant