Skip to content

Commit 4edbbea

Browse files
brentwritescodearshadmohammad
authored andcommitted
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 <brentwritescode@gmail.com> Reviewers: Damien Diederen <dd@crosstwine.com>, Mohammad Arshad <arshad@apache.org> Closes #1601 from brentwritescode/ZOOKEEPER-4194
1 parent de726d0 commit 4edbbea

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public class BasicDataEncryptionManager implements DataEncryptionManager {
3030
* (byte[])
3131
*/
3232
public String decryptData(byte[] encrypted) throws Exception {
33+
if(encrypted == null) {
34+
return "";
35+
}
3336
return new String(encrypted);
3437
}
3538

0 commit comments

Comments
 (0)