remm 01/12/02 14:19:26 Modified: catalina/src/share/org/apache/catalina/valves ErrorDispatcherValve.java Log: - Fix a NPE which occured when handling the 500 that was returned when the host mapper failed to map the request to a context. The status is still 500, but the error report gives some info on the problem, and no exception is logged. Revision Changes Path 1.8 +9 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java Index: ErrorDispatcherValve.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ErrorDispatcherValve.java 2001/11/17 08:31:45 1.7 +++ ErrorDispatcherValve.java 2001/12/02 22:19:26 1.8 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v 1.7 2001/11/17 08:31:45 remm Exp $ - * $Revision: 1.7 $ - * $Date: 2001/11/17 08:31:45 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v 1.8 2001/12/02 22:19:26 remm Exp $ + * $Revision: 1.8 $ + * $Date: 2001/12/02 22:19:26 $ * * ==================================================================== * @@ -104,7 +104,7 @@ * * @author Remy Maucherat * @author Craig R. McClanahan - * @version $Revision: 1.7 $ $Date: 2001/11/17 08:31:45 $ + * @version $Revision: 1.8 $ $Date: 2001/12/02 22:19:26 $ */ public class ErrorDispatcherValve @@ -214,6 +214,8 @@ Throwable throwable) { Context context = request.getContext(); + if (context == null) + return; Throwable realError = throwable; ErrorPage errorPage = findErrorPage(context, realError); @@ -281,6 +283,9 @@ // Handle a custom error page for this status code Context context = request.getContext(); + if (context == null) + return; + ErrorPage errorPage = context.findErrorPage(statusCode); if (errorPage != null) { response.setAppCommitted(false);
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>