incubator-droids-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r734859 - /incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/robot/walker/FileWorker.java
Date Thu, 15 Jan 2009 23:49:12 GMT
Author: ryan
Date: Thu Jan 15 15:49:12 2009
New Revision: 734859

URL: http://svn.apache.org/viewvc?rev=734859&view=rev
Log:
avoid null pointer on empty directory

Modified:
    incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/robot/walker/FileWorker.java

Modified: incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/robot/walker/FileWorker.java
URL: http://svn.apache.org/viewvc/incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/robot/walker/FileWorker.java?rev=734859&r1=734858&r2=734859&view=diff
==============================================================================
--- incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/robot/walker/FileWorker.java
(original)
+++ incubator/droids/trunk/droids-core/src/main/java/org/apache/droids/robot/walker/FileWorker.java
Thu Jan 15 15:49:12 2009
@@ -36,8 +36,11 @@
   {
     File file = task.getFile();
     if( file.isDirectory() ) {
-      for( File f : file.listFiles() ) {
-        queue.merge( new FileTask( f, task.getDepth()+1 ) );
+      File[] files = file.listFiles();
+      if( files != null ) {
+        for( File f : files ) {
+          queue.merge( new FileTask( f, task.getDepth()+1 ) );
+        }
       }
     }
     else {



Mime
View raw message