From 8938b7a67873c80a563791de961673e4a03af71e Mon Sep 17 00:00:00 2001 From: lujiefsi Date: Tue, 1 Dec 2020 19:38:16 +0530 Subject: [PATCH] HBASE-25332:fix One pontential NPE Closes #2715 Signed-off-by: Viraj Jasani --- .../org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java index 1d076855ff8..038e4dfc0e0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java @@ -467,7 +467,7 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager { } for (String znode : children) { byte[] data = ZKUtil.getData(watcher, ZNodePaths.joinZNode(groupBasePath, znode)); - if (data.length > 0) { + if (data != null && data.length > 0) { ProtobufUtil.expectPBMagicPrefix(data); ByteArrayInputStream bis = new ByteArrayInputStream(data, ProtobufUtil.lengthOfPBMagic(), data.length);