You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by cu...@apache.org on 2005/10/13 23:43:26 UTC

svn commit: r320931 - /lucene/nutch/branches/mapred/src/java/org/apache/nutch/fs/NutchFileSystem.java

Author: cutting
Date: Thu Oct 13 14:43:23 2005
New Revision: 320931

URL: http://svn.apache.org/viewcvs?rev=320931&view=rev
Log:
Fix a NullPointerException.

Modified:
    lucene/nutch/branches/mapred/src/java/org/apache/nutch/fs/NutchFileSystem.java

Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/fs/NutchFileSystem.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/fs/NutchFileSystem.java?rev=320931&r1=320930&r2=320931&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/java/org/apache/nutch/fs/NutchFileSystem.java (original)
+++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/fs/NutchFileSystem.java Thu Oct 13 14:43:23 2005
@@ -268,10 +268,12 @@
     public File[] listFiles(File f, FileFilter filter) throws IOException {
         Vector results = new Vector();
         File listing[] = listFilesRaw(f);
-        for (int i = 0; i < listing.length; i++) {
+        if (listing != null) {
+          for (int i = 0; i < listing.length; i++) {
             if (filter.accept(listing[i])) {
-                results.add(listing[i]);
+              results.add(listing[i]);
             }
+          }
         }
         return (File[]) results.toArray(new File[results.size()]);
     }