RED-6686 path fix

This commit is contained in:
Timo Bejan 2023-06-21 13:35:02 +03:00
parent d173cd8825
commit f8cf54be7a

View File

@ -53,7 +53,11 @@ public class EncryptionDecryptionService {
@SneakyThrows
public String encrypt(String strToEncrypt) {
return Base64.getEncoder().encodeToString(encrypt(strToEncrypt.getBytes()));
if (strToEncrypt != null) {
return Base64.getEncoder().encodeToString(encrypt(strToEncrypt.getBytes()));
}
return null;
}
@ -75,6 +79,10 @@ public class EncryptionDecryptionService {
@SneakyThrows
public String decrypt(String strToDecrypt) {
if (strToDecrypt == null) {
return null;
}
byte[] bytes = Base64.getDecoder().decode(strToDecrypt);
return new String(decrypt(bytes), StandardCharsets.UTF_8);
}