continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r386310 - /maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/servlet/RepositoryBrowseServlet.java
Date Thu, 16 Mar 2006 11:33:39 GMT
Author: evenisse
Date: Thu Mar 16 03:33:35 2006
New Revision: 386310

URL: http://svn.apache.org/viewcvs?rev=386310&view=rev
Log:
Fix NPE

Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/servlet/RepositoryBrowseServlet.java

Modified: maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/servlet/RepositoryBrowseServlet.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/servlet/RepositoryBrowseServlet.java?rev=386310&r1=386309&r2=386310&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/servlet/RepositoryBrowseServlet.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/servlet/RepositoryBrowseServlet.java
Thu Mar 16 03:33:35 2006
@@ -21,6 +21,7 @@
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -76,7 +77,12 @@
 
     private File getFile( HttpServletRequest req )
     {
-        String path = req.getPathInfo().substring( 1 );
+        String path = "";
+
+        if ( StringUtils.isNotEmpty( req.getPathInfo() ) )
+        {
+            path = req.getPathInfo().substring( 1 );
+        }
 
         //Clean url, so url like ../../../../a_file and /path/to_file like /etc/passwd won't
be allow
         String fileName = cleanUrl( path );



Mime
View raw message