465700 NullPointerException in ResourceHandler with welcome files

This commit is contained in:
Jan Bartel 2015-04-30 09:06:01 +10:00
parent d7de34af76
commit 25474ff7ab
1 changed files with 3 additions and 1 deletions

View File

@ -447,7 +447,9 @@ public class ResourceHandler extends HandlerWrapper
// handle directories
if (resource.isDirectory())
{
if (!request.getPathInfo().endsWith(URIUtil.SLASH))
String pathInfo = request.getPathInfo();
boolean endsWithSlash=(pathInfo==null?request.getServletPath():pathInfo).endsWith(URIUtil.SLASH);
if (!endsWithSlash)
{
response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getRequestURI(),URIUtil.SLASH)));
return;