cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java
Date Wed, 29 Oct 2003 12:01:03 GMT
ugo         2003/10/29 04:01:03

  Modified:    src/java/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java
  Log:
  Added a couple of null checks to FOM_Cocoon as a workaround in case an instance of FOM_Cocoon
is invalidated twice.
  
  Revision  Changes    Path
  1.15      +11 -3     cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- FOM_Cocoon.java	28 Oct 2003 17:21:14 -0000	1.14
  +++ FOM_Cocoon.java	29 Oct 2003 12:01:02 -0000	1.15
  @@ -134,7 +134,14 @@
   
       void invalidate() {
           // Clear the scope attribute
  -        this.getRequest().removeAttribute(FOM_JavaScriptFlowHelper.FOM_SCOPE);
  +        Request request = this.getRequest();
  +        if (request != null) {
  +            request.removeAttribute(FOM_JavaScriptFlowHelper.FOM_SCOPE);
  +        }
  +        else {
  +            // Cannot use logger here, as it might already be null
  +            System.err.println("Request is null. Might be trying to invalidate an already
invalidated FOM_Cocoon instance.");
  +        }
           
           // Cleanup everything
           this.request = null;
  @@ -882,7 +889,8 @@
        * @return The request
        */
       public Request getRequest() {
  -        return jsGet_request().request;
  +        FOM_Request fom_request = jsGet_request(); 
  +        return fom_request != null ? fom_request.request : null;
       }
   
       /**
  
  
  

Mime
View raw message