Skip to content

Commit

Permalink
Fix NullPointerException during full config save (gocd#5538)
Browse files Browse the repository at this point in the history
* Config saves were failing will reason null when we have following
  setup:
  - Install a v4 extension based elastic agent plugin
  - Define a cluster profile with some properties belonging to
    that v4 elastic agent plugin.

* In case of full config save, GoCD will try to encrypt secure
  value of plugin specified profiles using
  'PluginProfile.encryptSecureConfigurations'. As the v4 EA plugin
  did not have the capability to read the cluster profile
  configurations, it was failing with null pointer exception.

Fix:
* Verify Configurations exists on cluster profiles, as v4 plugins
  will not support cluster profile configurations.
  • Loading branch information
GaneshSPatil committed Apr 16, 2019
1 parent 35c13cd commit 07773b9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ protected boolean isSecure(String key) {

if (pluginInfo == null
|| pluginInfo.getClusterProfileSettings() == null
|| pluginInfo.getClusterProfileSettings().getConfigurations() == null
|| pluginInfo.getClusterProfileSettings().getConfiguration(key) == null) {
return false;
}
Expand Down

0 comments on commit 07773b9

Please sign in to comment.