diff options
Diffstat (limited to 'java/com/google/gerrit/server/project/ProjectState.java')
-rw-r--r-- | java/com/google/gerrit/server/project/ProjectState.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/java/com/google/gerrit/server/project/ProjectState.java b/java/com/google/gerrit/server/project/ProjectState.java index 6352f669f7..b350f3c7e0 100644 --- a/java/com/google/gerrit/server/project/ProjectState.java +++ b/java/com/google/gerrit/server/project/ProjectState.java @@ -475,19 +475,19 @@ public class ProjectState { * {@code PluginConfig#withInheritance(ProjectState.Factory)} */ public PluginConfig getPluginConfig(String pluginName) { - if (getConfig().getPluginConfigs().containsKey(pluginName)) { - Config config = new Config(); + Config config = new Config(); + String cachedPluginConfig = getConfig().getPluginConfigs().get(pluginName); + if (cachedPluginConfig != null) { try { - config.fromText(getConfig().getPluginConfigs().get(pluginName)); + config.fromText(cachedPluginConfig); } catch (ConfigInvalidException e) { // This is OK to propagate as IllegalStateException because it's a programmer error. // The config was converted to a String using Config#toText. So #fromText must not // throw a ConfigInvalidException throw new IllegalStateException("invalid plugin config for " + pluginName, e); } - return PluginConfig.create(pluginName, config, getConfig()); } - return PluginConfig.create(pluginName, new Config(), getConfig()); + return PluginConfig.create(pluginName, config, getConfig()); } public Optional<BranchOrderSection> getBranchOrderSection() { |