diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java index 6231425a987..a10f44898b0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java @@ -683,9 +683,13 @@ public class RMContextImpl implements RMContext { } public Set getExclusiveEnforcedPartitions() { - String[] configuredPartitions = getYarnConfiguration().getStrings( - YarnConfiguration.EXCLUSIVE_ENFORCED_PARTITIONS); Set exclusiveEnforcedPartitions = new HashSet<>(); + Configuration conf = getYarnConfiguration(); + if (conf == null) { + return new HashSet<>(); + } + String[] configuredPartitions = conf.getStrings( + YarnConfiguration.EXCLUSIVE_ENFORCED_PARTITIONS); if (configuredPartitions != null) { for (String partition : configuredPartitions) { exclusiveEnforcedPartitions.add(partition);