dgraham 2003/03/23 20:33:42 Modified: src/share/org/apache/struts/taglib/logic PresentTag.java Log: Don't create empty cookies array if null, just don't run the loop at all. Revision Changes Path 1.14 +10 -11 jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java Index: PresentTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- PresentTag.java 24 Mar 2003 04:19:21 -0000 1.13 +++ PresentTag.java 24 Mar 2003 04:33:42 -0000 1.14 @@ -119,13 +119,12 @@ if (cookie != null) { Cookie cookies[] = request.getCookies(); - if (cookies == null) { - cookies = new Cookie[0]; - } - for (int i = 0; i < cookies.length; i++) { - if (cookie.equals(cookies[i].getName())) { - present = true; - break; + if (cookies != null) { + for (int i = 0; i < cookies.length; i++) { + if (cookie.equals(cookies[i].getName())) { + present = true; + break; + } } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]