This is an automated email from the ASF dual-hosted git repository.

arshad pushed a commit to branch branch-3.6
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.6 by this push:
     new e19926a  ZOOKEEPER-4194: ZooInspector throws NullPointerExceptions to 
console when node data is null This is a very minor fix to a 
NullPointerException present in the ZooInspector utility which prevents a 
NullPointerException getting thrown when ZooInspector inspects an empty node.
e19926a is described below

commit e19926a51c5d30ea8f034c5d1a377ff0ac53ad9c
Author: brentwritescode <[email protected]>
AuthorDate: Sat Mar 27 23:30:11 2021 +0530

    ZOOKEEPER-4194: ZooInspector throws NullPointerExceptions to console when 
node data is null
    This is a very minor fix to a NullPointerException present in the 
ZooInspector utility which prevents a NullPointerException getting thrown when 
ZooInspector inspects an empty node.
    
    Author: brentwritescode <[email protected]>
    
    Reviewers: Damien Diederen <[email protected]>, Mohammad Arshad 
<[email protected]>
    
    Closes #1601 from brentwritescode/ZOOKEEPER-4194
    
    (cherry picked from commit 4edbbea5566925390b32702a97c17f7a76e32de5)
    Signed-off-by: Mohammad Arshad <[email protected]>
---
 .../zookeeper/inspector/encryption/BasicDataEncryptionManager.java     | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java
 
b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java
index a9e5ac4..c8662db 100644
--- 
a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java
+++ 
b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java
@@ -30,6 +30,9 @@ public class BasicDataEncryptionManager implements 
DataEncryptionManager {
      * (byte[])
      */
     public String decryptData(byte[] encrypted) throws Exception {
+        if(encrypted == null) {
+            return "";
+        }
         return new String(encrypted);
     }
 

Reply via email to