From 24c8d8c635a694d9e8832c8de4fef508c49c6987 Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Fri, 27 Nov 2015 14:39:23 +0000 Subject: [PATCH] ServletPath is never null but it might be zero length. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1716881 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/servlets/DefaultServlet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java b/java/org/apache/catalina/servlets/DefaultServlet.java index 02eb1ffc9d3d..1043f31bc8c1 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -350,11 +350,11 @@ protected String getRelativePath(HttpServletRequest request) { } StringBuilder result = new StringBuilder(); - if (servletPath != null) { + if (servletPath.length() > 0) { result.append(servletPath); - if (pathInfo != null) { - result.append(pathInfo); - } + } + if (pathInfo != null) { + result.append(pathInfo); } if (result.length() == 0) { result.append('/');