Prevent an NPE when a long running request completes if the associated web application was destroyed while the request was processing
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1145160 13f79535-47bb-0310-9956-
ffa450edef68
// place
if (!(request.isAsync() || (asyncAtStart && request.getAttribute(
RequestDispatcher.ERROR_EXCEPTION) != null))) {
- context.fireRequestDestroyEvent(request);
+ // Protect against NPEs if context was destroyed during a long
+ // running request.
+ StandardContext c = context;
+ if (c != null && c.getState().isAvailable()) {
+ context.fireRequestDestroyEvent(request);
+ }
}
}
}
<fix>
Fix regression in year number formatting for AccessLogValve. (rjung)
</fix>
+ <fix>
+ <bug>51494</bug>: Prevent an NPE when a long running request completes
+ if the associated web application was destroyed while the request was
+ processing. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">