You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/01/13 01:49:42 UTC

[GitHub] [incubator-shardingsphere] minghu-zhang commented on a change in pull request #3925: Solve the bug that the encryption result exception value is 'null' string when the encryption field value is null

minghu-zhang commented on a change in pull request #3925: Solve the bug that the encryption result exception value is 'null' string when the encryption field value is null
URL: https://github.com/apache/incubator-shardingsphere/pull/3925#discussion_r365629462
 
 

 ##########
 File path: encrypt-core/encrypt-core-common/src/main/java/org/apache/shardingsphere/encrypt/strategy/impl/AESEncryptor.java
 ##########
 @@ -43,44 +44,47 @@
 @Getter
 @Setter
 public final class AESEncryptor implements Encryptor {
-    
+
     private static final String AES_KEY = "aes.key.value";
-    
+
     private Properties properties = new Properties();
-    
+
     @Override
     public String getType() {
         return "AES";
     }
-    
+
     @Override
     public void init() {
     }
-    
+
     @Override
     @SneakyThrows
     public String encrypt(final Object plaintext) {
+        if (StringUtil.isNullOrEmpty(plaintext)) {
 
 Review comment:
   if value is null, the encryption method will get a 'null' string result.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services