Merge branch 'RED-9512' into 'main'

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

See merge request fforesight/tenant-user-management-service!116
This commit is contained in:
Ali Oezyetimoglu 2024-07-02 16:36:26 +02:00
commit f9668a3c07

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()));
}