I added your comment to https://issues.apache.org/jira/browse/SHIRO-141
as it seems to be related. Regards, Les On Tue, Feb 23, 2010 at 9:23 PM, DutrowLLC1 <[email protected]> wrote: > > I don't fully understand this code or the possible negative repercussions of > this fix, but this function threw a NullPointerException for me, so I made > it so it wouldn't do that anymore by adding code for it to check if > "request==null" before attempting to call request.getCookies(); > > Is this ok? If it is, could it be added to the code base so that the next > time I update from SVN, it doesn't write over my fix? > > private static Cookie getCookie(HttpServletRequest request, String > cookieName) { > Cookie cookies[] = null; > if( request != null ){ > cookies = request.getCookies(); > } > if (cookies != null) { > for (Cookie cookie : cookies) { > if (cookie.getName().equals(cookieName)) { > return cookie; > } > } > } > return null; > } > -- > View this message in context: > http://n2.nabble.com/I-may-have-fixed-a-bug-in-CookieAttribute-java-tp4623279p4623279.html > Sent from the Shiro User mailing list archive at Nabble.com. >
