continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r787651 - /continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
Date Tue, 23 Jun 2009 12:05:40 GMT
Author: evenisse
Date: Tue Jun 23 12:05:39 2009
New Revision: 787651

URL: http://svn.apache.org/viewvc?rev=787651&view=rev
Log:
Fix potential NPE
merge 787649:787650 from continuum-1.3.x branch

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java?rev=787651&r1=787650&r2=787651&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
Tue Jun 23 12:05:39 2009
@@ -23,6 +23,7 @@
 import java.util.Map;
 
 import org.apache.continuum.dao.ProjectDao;
+import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 
@@ -63,6 +64,14 @@
 
         File[] files = workingDirectory.listFiles();
 
+        if ( files == null )
+        {
+            //workingDirectory isn't a directory but a file. Not possible in theory.
+            String msg = workingDirectory.getAbsolutePath() + " isn't a directory but a file.";
+            getLogger().error( msg );
+            throw new ContinuumException( msg );
+        }
+
         setWorkingDirectoryExist( context, files.length > 0 );
     }
 



Mime
View raw message