Issue #4671 - fix NPE from CustomRequestLog logRequestCookie

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-03-16 11:17:09 +11:00
parent 965483e4d9
commit 288caa99f7
1 changed files with 8 additions and 4 deletions

View File

@ -1029,12 +1029,16 @@ public class CustomRequestLog extends ContainerLifeCycle implements RequestLog
private static void logRequestCookie(String arg, StringBuilder b, Request request, Response response)
{
for (Cookie c : request.getCookies())
Cookie[] cookies = request.getCookies();
if (cookies != null)
{
if (arg.equals(c.getName()))
for (Cookie c : cookies)
{
b.append(c.getValue());
return;
if (arg.equals(c.getName()))
{
b.append(c.getValue());
return;
}
}
}