tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector HttpRequestBase.java
Date Tue, 12 Sep 2000 01:00:28 GMT
craigmcc    00/09/11 18:00:27

  Modified:    catalina/src/share/org/apache/catalina/connector
                        HttpRequestBase.java
  Log:
  Add a sanity check to the getSession(boolean) method so that it will return
  null (instead of throw an NPE) when no context has yet been assigned to this
  request.
  
  Submitted by: Bernd Eilers (bei@staroffice.de)
  PR: BugRat Bug Report #101
  
  Revision  Changes    Path
  1.8       +8 -4      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java
  
  Index: HttpRequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HttpRequestBase.java	2000/09/01 21:45:55	1.7
  +++ HttpRequestBase.java	2000/09/12 01:00:27	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
1.7 2000/09/01 21:45:55 craigmcc Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/09/01 21:45:55 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
1.8 2000/09/12 01:00:27 craigmcc Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/09/12 01:00:27 $
    *
    * ====================================================================
    *
  @@ -98,7 +98,7 @@
    * be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2000/09/01 21:45:55 $
  + * @version $Revision: 1.8 $ $Date: 2000/09/12 01:00:27 $
    */
   
   public class HttpRequestBase
  @@ -977,6 +977,10 @@
        * @param create Create a new session if one does not exist
        */
       public HttpSession getSession(boolean create) {
  +
  +        // There cannot be a session if no context has been assigned yet
  +        if (context == null)
  +            return (null);
   
   	// Return the current session if it exists and is valid
   	if ((session != null) && !session.isValid())
  
  
  

Mime
View raw message