DaanHoogland commented on code in PR #6812:
URL: https://github.com/apache/cloudstack/pull/6812#discussion_r992175399


##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -856,10 +855,16 @@ public Configuration updateConfiguration(final 
UpdateCfgCmd cmd) throws InvalidP
                 s_logger.warn("Probably the component manager where 
configuration variable " + name + " is defined needs to implement Configurable 
interface");
                 throw new InvalidParameterValueException("Config parameter 
with name " + name + " doesn't exist");
             }
-            catergory = _configDepot.get(name).category();
+            category = _configDepot.get(name).category();
         } else {
-            catergory = config.getCategory();
+            category = config.getCategory();
+        }
+
+        String value = cmd.getValue();
+        if (config != null && config.isEncrypted()) {
+            value = DBEncryptionUtil.encrypt(value);
         }
+        CallContext.current().setEventDetails(String.format(" Name: %s New 
Value: %s", name, config.isEncrypted() ? "*****" : value == null ? "" : value));

Review Comment:
   `config` may be null here, i.e. the update command may contain a config key 
that does not exist in the DB. In that case `config.isEncrypted()` yoelds an NPE



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to