Hi Carsten,

That fixed the first problem but I'm afraid that cookies.length is called
without testing for null in 5 more places (sorry for not spotting this
earlier):

XSPCookieHelper.getCookie(Map objectModel , String cookieName ,int
cookieIndex):


        if (retrieveByName)
        {
            for(count=0; count<cookies.length; count++)      <---- *here*
            {
                currentCookie = cookies[count];

                if (currentCookie.getName().equals(cookieName))
                    matchFound = true;
            }
        }
        else if(retrieveByIndex)
        {
            if(cookies.length > cookieIndex)   <---- *here*
            {
                currentCookie = cookies[cookieIndex];
                matchFound = true;
            }
        }

XSPCookieHelper.returnCookieProperty(Map objectModel , String cookieName ,
int cookieIndex , String propertyPrefix):

        Cookie[] cookies = request.getCookies();

        if (cookies.length > 0)  <---- *here*
        {
            if (retrieveByName)
            {
                for(count=0; count<cookies.length; count++)   <---- *here*
                {
                    currentCookie = cookies[count];

                    if (currentCookie.getName().equals(cookieName))
                        matchFound = true;
                }
            }
            else if (retrieveByIndex)
            {
                if(cookies.length > cookieIndex) <---- *here*
                {
                    currentCookie = cookies[cookieIndex];
                    matchFound = true;
                }
            }

Do you want me to fix these? If so, what format do you want the patches in?

Best Regards,

Chris


> -----Original Message-----
> From: Carsten Ziegeler [mailto:[EMAIL PROTECTED]]
> Sent: 16 August 2001 13:23
> To: [EMAIL PROTECTED]
> Subject: AW: HttpRequest.getCookies() causes NPE in
> XSPCookieHelper.getCookies()
>
>
> Thanks for reporting this Chris.
>
> I fixed it, please check if this is working now.
>
>
> Carsten
>
> Open Source Group                        sunShine - b:Integrated
> ================================================================
> Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
> www.sundn.de                          mailto: [EMAIL PROTECTED]
> ================================================================
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Chris Newland [mailto:[EMAIL PROTECTED]]
> > Gesendet: Donnerstag, 16. August 2001 13:58
> > An: Cocoon Dev
> > Betreff: HttpRequest.getCookies() causes NPE in
> > XSPCookieHelper.getCookies()
> >
> >
> > Hi All,
> >
> > I think there is an unhandled case in
> > org.apache.cocoon.environment.http.HttpRequest (CVS 1.1.1.1.2.4)
> > that causes
> > a null pointer exception in
> > org.apache.cocoon.components.language.markup.xsp.XSPCookieHelper (CVS
> > 1.2.2.1).


<snip>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to