Przeglądaj źródła

ZOOKEEPER-2978: fix potential null pointer exception when deleting node

At line 518, 'existWatches.remove(clientPath)' is null because watches for clientPath is already removed.

Author: 07c00h <07c00h@gmail.com>

Reviewers: Abraham Fine <afine@apache.org>

Closes #461 from achimbab/master
achimbab 7 lat temu
rodzic
commit
f0b67b6e49

+ 1 - 1
src/java/main/org/apache/zookeeper/ZooKeeper.java

@@ -515,7 +515,7 @@ public class ZooKeeper implements AutoCloseable {
                 synchronized (existWatches) {
                     Set<Watcher> list = existWatches.remove(clientPath);
                     if (list != null) {
-                        addTo(existWatches.remove(clientPath), result);
+                        addTo(list, result);
                         LOG.warn("We are triggering an exists watch for delete! Shouldn't happen!");
                     }
                 }