See below.

> -----Original Message-----
> From: Stanley,Michael P. [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 5:48 PM
> To: Turbine Users List
> Subject: Re: DefaultCookieParser null pointer exception
> 
> 
> Streithorst, Kip wrote:
> 
> >The NPE is thrown in setRunData(RunData data) of the
> >DefaultCookieParser.java, because Cookie [] cookies =
> >data.getRequest().getCookies() is never checked for null 
> before being used.
> >
> Is this desired?
> 
> Mike
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

That behavior is not desired, because on the next line, 
cookies.length is called, but when cookies is null, an NPE is returned. By
wrapping that part of code in a cookies != null if, you will get a
CookieParser that has no key,value pairs in it if no cookies were returned
by the client, as of now you get an NPE.

Thanks,
Kip

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to