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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4edbbea  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.
4edbbea is described below

commit 4edbbea5566925390b32702a97c17f7a76e32de5
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
---
 .../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