Browse Source

HADOOP-5292. Fix NPE in KFS::getBlockLocations. (Sriram Rao via lohit)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@746891 13f79535-47bb-0310-9956-ffa450edef68
Lohit Vijaya Renu 16 years ago
parent
commit
dde6a00ada
2 changed files with 5 additions and 0 deletions
  1. 2 0
      CHANGES.txt
  2. 3 0
      src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

+ 2 - 0
CHANGES.txt

@@ -203,6 +203,8 @@ Trunk (unreleased changes)
     HADOOP-5227. Fix distcp so -update and -delete can be meaningfully
     HADOOP-5227. Fix distcp so -update and -delete can be meaningfully
     combined. (Tsz Wo (Nicholas), SZE via cdouglas)
     combined. (Tsz Wo (Nicholas), SZE via cdouglas)
 
 
+    HADOOP-5292. Fix NPE in KFS::getBlockLocations. (Sriram Rao via lohit)
+
 Release 0.20.0 - Unreleased
 Release 0.20.0 - Unreleased
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 3 - 0
src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

@@ -291,6 +291,9 @@ public class KosmosFileSystem extends FileSystem {
       }
       }
       String srep = makeAbsolute(file.getPath()).toUri().getPath();
       String srep = makeAbsolute(file.getPath()).toUri().getPath();
       String[][] hints = kfsImpl.getDataLocation(srep, start, len);
       String[][] hints = kfsImpl.getDataLocation(srep, start, len);
+      if (hints == null) {
+        return null;
+      }
       BlockLocation[] result = new BlockLocation[hints.length];
       BlockLocation[] result = new BlockLocation[hints.length];
       long blockSize = getDefaultBlockSize();
       long blockSize = getDefaultBlockSize();
       long length = len;
       long length = len;