From f8cf54be7abccd0f613445442d2a1d9dcc14cd3b Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Wed, 21 Jun 2023 13:35:02 +0300 Subject: [PATCH] RED-6686 path fix --- .../tenantcommons/EncryptionDecryptionService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/knecon/fforesight/tenantcommons/EncryptionDecryptionService.java b/src/main/java/com/knecon/fforesight/tenantcommons/EncryptionDecryptionService.java index 8d45d32..0a5e70a 100644 --- a/src/main/java/com/knecon/fforesight/tenantcommons/EncryptionDecryptionService.java +++ b/src/main/java/com/knecon/fforesight/tenantcommons/EncryptionDecryptionService.java @@ -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); }