You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/10/04 11:58:07 UTC

[GitHub] [zookeeper] mahitab-farid commented on a change in pull request #1475: Zookeeper muse bugbash2020 check null child names

mahitab-farid commented on a change in pull request #1475:
URL: https://github.com/apache/zookeeper/pull/1475#discussion_r499238526



##########
File path: zookeeper-recipes/zookeeper-recipes-queue/src/main/java/org/apache/zookeeper/recipes/queue/DistributedQueue.java
##########
@@ -94,13 +98,17 @@ private String smallestChildName() throws KeeperException, InterruptedException
         long minId = Long.MAX_VALUE;
         String minName = "";
 
-        List<String> childNames;
+        List<String> childNames = null;
 
         try {
             childNames = zookeeper.getChildren(dir, false);
         } catch (KeeperException.NoNodeException e) {
             LOG.warn("Unexpected exception", e);
             return null;
+        } finally {
+            if (childNames == null) {
+                return null;

Review comment:
       Ok, I will make it outside try block.




----------------------------------------------------------------
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