You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2001/12/02 23:17:41 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves ErrorDispatcherValve.java

remm        01/12/02 14:17:41

  Modified:    catalina/src/share/org/apache/catalina/valves Tag:
                        tomcat_40_branch 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
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.4   +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.5.2.3
  retrieving revision 1.5.2.4
  diff -u -r1.5.2.3 -r1.5.2.4
  --- ErrorDispatcherValve.java	2001/11/17 08:41:51	1.5.2.3
  +++ ErrorDispatcherValve.java	2001/12/02 22:17:41	1.5.2.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v 1.5.2.3 2001/11/17 08:41:51 remm Exp $
  - * $Revision: 1.5.2.3 $
  - * $Date: 2001/11/17 08:41:51 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v 1.5.2.4 2001/12/02 22:17:41 remm Exp $
  + * $Revision: 1.5.2.4 $
  + * $Date: 2001/12/02 22:17:41 $
    *
    * ====================================================================
    *
  @@ -104,7 +104,7 @@
    *
    * @author Remy Maucherat
    * @author Craig R. McClanahan
  - * @version $Revision: 1.5.2.3 $ $Date: 2001/11/17 08:41:51 $
  + * @version $Revision: 1.5.2.4 $ $Date: 2001/12/02 22:17:41 $
    */
   
   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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>