Skip to content

NullPointerException in RepositoryValidationInterceptorFactoryR4 when hapi.fhir.max_page_size is configured #956

Description

@juergenbernhardt

When configuring hapi.fhir.max_page_size, the application throws a NullPointerException in RepositoryValidationInterceptorFactoryR4.

Affected code:

https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/java/ca/uhn/fhir/jpa/starter/common/validation/RepositoryValidationInterceptorFactoryR4.java#L53

It appears that results.size() is accessed although results can become null.

Additionally, this only seems to happen when the number of found results is greater than or equal to hapi.fhir.max_page_size.

If the number of results is below max_page_size, results.size() is not null.

steps to reproduce

configure

hapi:
  fhir:
    max_page_size: 100

expected behavior

The server should start normally and validation should not throw a NullPointerException, independent of the configured max_page_size.

version:
HAPI FHIR JPA Server Starter: 8.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions