dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

NullPointerException when searching for components without filter

Open bugbouncer opened this issue 5 years ago • 1 comments

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:

  1. Navigate to "Components"
  2. 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.

bugbouncer avatar Mar 25 '21 15:03 bugbouncer

This was fixed sometime in the past, but not sure when.

nscuro avatar Sep 21 '26 15:09 nscuro