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.
Thanks, Kip -----Original Message----- From: Gareth Coltman [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 17, 2002 4:21 AM To: Turbine Users List; [EMAIL PROTECTED] Subject: RE: DefaultCookieParser null pointer exception Hmm. I seem to remember a similar problem, but I'm sure all we did was check for null like: if(data.getCookies() != null) get a specific cookie Does just call data.getCookies alone throw a npe? -----Original Message----- From: Michael Stanley [mailto:[EMAIL PROTECTED]] Sent: 17 January 2002 04:10 To: 'Turbine Users List' Subject: DefaultCookieParser null pointer exception In my code I use the following to obtain a CookieParser I get the following error when Client Browser have cookies disabled - java.lang.NullPointerException at org.apache.turbine.util.parser.DefaultCookieParser.setRunData(DefaultCoo kieParser.java:156) at org.apache.turbine.services.rundata.DefaultTurbineRunData.getCookies(Def aultTurbineRunData.java:518) at org.mitre.connectme.web.modules.screens.Default.doBuildTemplate(Default. java:47) Default.java:47 is where I call data.getCookies () Is there a way to test if a client has cookies enabled before calling data.getCookies? Is this the desired behavior? I would think if cookies were disabled, get cookies should just return a null cookie parser. I'm try to avoid a try catch block here. There must be a more elegant way. Thoughts? Mike -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
