RED-9512: added null check for SMTP password when updating configuration

This commit is contained in:
Ali Oezyetimoglu 2024-07-02 14:45:50 +02:00
parent 310339a5d9
commit aa9fe087f5

View File

@ -57,7 +57,7 @@ public class SMTPConfigurationController implements SMTPConfigurationResource, P
var propertiesMap = convertSMTPConfigurationModelToMap(smtpConfigurationModel);
realmRepresentation.setSmtpServer(propertiesMap);
if (!smtpConfigurationModel.getPassword().matches("\\**")) {
if (smtpConfigurationModel.getPassword() != null && !smtpConfigurationModel.getPassword().matches("\\**")) {
realmRepresentation.getAttributesOrEmpty().put(SMTP_PASSWORD_KEY, encryptionDecryptionService.encrypt(smtpConfigurationModel.getPassword()));
}