diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java index 5915c8baba032..62b7fc3ae5a49 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java @@ -195,10 +195,13 @@ private ResponseBuilderImpl fromResponse(Response response) { if (response.hasEntity()) { b.entity(response.getEntity()); } - for (String headerName : response.getHeaders().keySet()) { - List headerValues = response.getHeaders().get(headerName); - for (Object headerValue : headerValues) { - b.header(headerName, headerValue); + var headers = response.getHeaders(); + if (headers != null) { + for (String headerName : headers.keySet()) { + List headerValues = headers.get(headerName); + for (Object headerValue : headerValues) { + b.header(headerName, headerValue); + } } } return (ResponseBuilderImpl) b;