hapi-fhir
hapi-fhir copied to clipboard
Subscriptions with null content cause NullPointerException
Description
A Subscription with content set to null
will cause the getPayloadByContent method to throw a NullPointerException.
To Reproduce
Check out the rel_7_1_tracking branch of HAPI FHIR JPA Server Starter (https://github.com/hapifhir/hapi-fhir-jpaserver-starter/tree/rel_7_1_tracking)
In an IDE, find and run ca.uhn.fhir.jpa.starter.ExampleServerR5IT.testWebsocketSubscription
. It will fail, with the root cause being a NullPointerException.
Expected behavior
If the content is an actual null
, it should not fail, and return Optional.empty()
.