Skip to content

Commit

Permalink
Merge pull request #11700 from jetty/fix/12.0.x/npe-response-recycled
Browse files Browse the repository at this point in the history
Issue #11699 - ISE when Response does not exist.
  • Loading branch information
joakime committed Apr 26, 2024
2 parents 429809e + 9163335 commit 7da9056
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -279,7 +279,9 @@ public Request getRequest()
public ServletContextResponse getServletContextResponse()
{
ServletContextRequest request = _servletContextRequest;
return request == null ? null : request.getServletContextResponse();
if (_servletContextRequest == null)
throw new IllegalStateException("Request/Response does not exist (likely recycled)");
return request.getServletContextResponse();
}

/**
Expand All @@ -291,6 +293,8 @@ public ServletContextResponse getServletContextResponse()
*/
public Response getResponse()
{
if (_response == null)
throw new IllegalStateException("Response does not exist (likely recycled)");
return _response;
}

Expand Down

0 comments on commit 7da9056

Please sign in to comment.