Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13066
Modified Files:
TypeDirective.java
Log Message:
fixed potential infinite loop when variable is undefined.
Index: TypeDirective.java
===================================================================
RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/TypeDirective.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TypeDirective.java 12 Jun 2003 00:47:44 -0000 1.8
--- TypeDirective.java 29 Mar 2006 16:27:44 -0000 1.9
***************
*** 25,28 ****
--- 25,29 ----
import org.webmacro.engine.BuildContext;
import org.webmacro.engine.BuildException;
+ import org.webmacro.engine.UndefinedMacro;
import org.webmacro.engine.Variable;
import org.webmacro.util.Settings;
***************
*** 148,155 ****
// evaluate the _object reference down to its base object
! while (o instanceof Macro)
o = ((Macro) o).evaluate(context);
! if (o == null)
{
// the Variable to check isn't in the Context.
--- 149,156 ----
// evaluate the _object reference down to its base object
! while (o instanceof Macro && o != UndefinedMacro.getInstance())
o = ((Macro) o).evaluate(context);
! if (o == null || o == UndefinedMacro.getInstance())
{
// the Variable to check isn't in the Context.
|