jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-taglibs/request/src/org/apache/taglibs/request ExistsQueryStringTag.java
Date Thu, 04 Apr 2002 19:30:52 GMT
glenn       02/04/04 11:30:52

  Modified:    request/src/org/apache/taglibs/request
                        ExistsQueryStringTag.java
  Log:
  Fix a NPE
  
  Revision  Changes    Path
  1.4       +13 -11    jakarta-taglibs/request/src/org/apache/taglibs/request/ExistsQueryStringTag.java
  
  Index: ExistsQueryStringTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/ExistsQueryStringTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExistsQueryStringTag.java	13 Jul 2001 00:09:02 -0000	1.3
  +++ ExistsQueryStringTag.java	4 Apr 2002 19:30:52 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/ExistsQueryStringTag.java,v
1.3 2001/07/13 00:09:02 glenn Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/07/13 00:09:02 $
  + * $Header: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/ExistsQueryStringTag.java,v
1.4 2002/04/04 19:30:52 glenn Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/04/04 19:30:52 $
    *
    * ====================================================================
    *
  @@ -114,14 +114,16 @@
   	String query =
   	    ((HttpServletRequest)pageContext.getRequest()).getQueryString();
   
  -	StringTokenizer st = new StringTokenizer(query,"&");
  -	String prefix = name + "=";
  -	while( st.hasMoreTokens() ) {
  -	    if( st.nextToken().startsWith(prefix) ) {
  -		result = true;
  -		break;
  -	    }
  -	}
  +        if( query != null ) {
  +            StringTokenizer st = new StringTokenizer(query,"&");
  +            String prefix = name + "=";
  +            while( st.hasMoreTokens() ) {
  +                if( st.nextToken().startsWith(prefix) ) {
  +                    result = true;
  +                    break;
  +                }
  +            }
  +        }
   
   	if( value == result )
   	    return EVAL_BODY_INCLUDE;
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message