diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockTokenWithDFSStriped.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockTokenWithDFSStriped.java index 0b39456bf8f..124db17e6c0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockTokenWithDFSStriped.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockTokenWithDFSStriped.java @@ -136,7 +136,7 @@ public class TestBlockTokenWithDFSStriped extends TestBlockTokenWithDFS { LocatedBlock[] internalBlocks = StripedBlockUtil.parseStripedBlockGroup (lsb, cellSize, dataBlocks, parityBlocks); for (LocatedBlock internalBlock : internalBlocks) { - if(super.isBlockTokenExpired(internalBlock)){ + if(internalBlock != null && super.isBlockTokenExpired(internalBlock)) { return true; } }