Amend HDFS-2795. Fix PersistBlocks failure due to an NPE in isPopulatingReplQueues()

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1623@1232510 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2012-01-17 17:57:36 +00:00
parent 0c1450ca5d
commit 4c7a6c6c3f
1 changed files with 2 additions and 1 deletions

View File

@ -3681,7 +3681,8 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
@Override
public boolean isPopulatingReplQueues() {
if (!haContext.getState().shouldPopulateReplQueues()) {
if (haContext != null && // null during startup!
!haContext.getState().shouldPopulateReplQueues()) {
return false;
}
// safeMode is volatile, and may be set to null at any time