From 02f6104dc289a3b9d691fdf5abcd4bf226600610 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Sun, 6 Nov 2011 22:47:17 +0000 Subject: [PATCH] HBASE-4753 org.apache.hadoop.hbase.regionserver.TestHRegionInfo#testGetSetOfHTD throws NPE on trunk git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1198581 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../java/org/apache/hadoop/hbase/util/FSTableDescriptors.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index b28c15ba3af..803c7eb6c04 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -455,6 +455,8 @@ Release 0.92.0 - Unreleased HBASE-4745 LRU statistics thread should be a daemon HBASE-4749 TestMasterFailover#testMasterFailoverWithMockedRITOnDeadRS occasionally fails + HBASE-4753 org.apache.hadoop.hbase.regionserver.TestHRegionInfo#testGetSetOfHTD + throws NPE on trunk (nkeywal) TESTS HBASE-4450 test for number of blocks read: to serve as baseline for expected diff --git a/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java b/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java index b65849121d5..b2783aedbb0 100644 --- a/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java +++ b/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java @@ -430,7 +430,9 @@ public class FSTableDescriptors implements TableDescriptors { FileSystem fs = FSUtils.getCurrentFileSystem(conf); FileStatus status = getTableInfoPath(fs, FSUtils.getRootDir(conf), tableName); // The below deleteDirectory works for either file or directory. - if (fs.exists(status.getPath())) FSUtils.deleteDirectory(fs, status.getPath()); + if (status != null && fs.exists(status.getPath())) { + FSUtils.deleteDirectory(fs, status.getPath()); + } } /**