NPE protect DefaultServlet iteration through request fields

This commit is contained in:
Jan Bartel 2014-10-16 19:02:21 +11:00
parent ec79a6f88e
commit 6a6c8bacda
1 changed files with 17 additions and 14 deletions

View File

@ -716,6 +716,8 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
for (int i=fields.size();i-->0;) for (int i=fields.size();i-->0;)
{ {
HttpField field=fields.getField(i); HttpField field=fields.getField(i);
if (field.getHeader() != null)
{
switch (field.getHeader()) switch (field.getHeader())
{ {
case IF_MATCH: case IF_MATCH:
@ -734,6 +736,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
} }
} }
} }
}
else else
{ {
ifm=request.getHeader(HttpHeader.IF_MATCH.asString()); ifm=request.getHeader(HttpHeader.IF_MATCH.asString());