DependencyTrack / dependency-track

Dependency-Track is an intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain.
https://dependencytrack.org/
Apache License 2.0
2.43k stars 529 forks source link

Fix NPE when querying component metadata for projects without findings #3889

Closed nscuro closed 5 days ago

nscuro commented 6 days ago

Description

Fixes NPE when querying component metadata for projects without findings.

The method to bulk query component metadata turned out to return metadata for all components when given an empty list is input. Trying to correlate the returned data with the non-existent findings caused a NPE.

Addressed Issue

Regression introduced in #3869

Additional Details

N/A

Checklist

codacy-production[bot] commented 5 days ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.00% (target: -1.00%) :white_check_mark: 100.00% (target: 70.00%)
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (6def6128c1e5046756cadd4f2327f2ad02dad6ab) | 21901 | 16648 | 76.01% | | | Head commit (6727a14a212a101542bbb6ed9389ed7dedf02773) | 21903 (+2) | 16650 (+2) | 76.02% (**+0.00%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#3889) | 2 | 2 | **100.00%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences


:rocket: Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more