velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@locus.apache.org
Subject cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/directive Foreach.java
Date Sun, 26 Nov 2000 10:18:14 GMT
jvanzyl     00/11/26 02:18:13

  Modified:    src/java/org/apache/velocity/runtime/directive Foreach.java
  Log:
  - must add the check after init() in render() to make sure the
    list object isn't still empty.
  
  Revision  Changes    Path
  1.23      +9 -2      jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Foreach.java
  
  Index: Foreach.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/directive/Foreach.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Foreach.java	2000/11/25 21:31:30	1.22
  +++ Foreach.java	2000/11/26 10:18:13	1.23
  @@ -85,7 +85,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: Foreach.java,v 1.22 2000/11/25 21:31:30 jvanzyl Exp $
  + * @version $Id: Foreach.java,v 1.23 2000/11/26 10:18:13 jvanzyl Exp $
    */
   public class Foreach extends Directive
   {
  @@ -252,10 +252,17 @@
                       try
                       {
                           init(context, node);
  +                        
  +                        /*
  +                         * Check again, if the list is still
  +                         * empty then return false.
  +                         */
  +                        if (node.getInfo() == INFO_EMPTY_LIST_OBJECT)
  +                            return false;
                       }
                       catch (Exception e)
                       {
  -                        // do nothing.
  +                        return false;
                       }
                   }
               }
  
  
  

Mime
View raw message