dependency-track
dependency-track copied to clipboard
NullPointerException when searching for components without filter
Current Behavior:
This is a bug of category "not so nice". There is no impact on functionality. When you perform a search for components, a warning is written to the logs.
Steps to Reproduce:
- Navigate to "Components"
- Do not enter anything - Click "Search"
The log shows 2 warnings:
WARN unhandled due to prior sendError
WARN /api/v1/component/identity
The stack trace attached to the logs shows:
java.lang.NullPointerException: null
at org.dependencytrack.persistence.QueryManager.getComponents(QueryManager.java:759)`
at org.dependencytrack.resources.v1.ComponentResource.getComponentByIdentity(ComponentResource.java:153)
Expected Behavior:
The case where a user enters no filter criteria should be handled more gracefully by Dependency Track, without issuing a warning.
Environment:
- Dependency-Track Version: 4.2
- Distribution: Docker
- BOM Format & Version: n/a
- Database Server: PostgreSQL
- Browser: Chrome
Additional Details:
The method QueryManager::getComponents handles many cases of filters, being entered by the users, but not the empty-filters case.
This was fixed sometime in the past, but not sure when.