Skip to content

Commit

Permalink
fix issue #3533 (#3548)
Browse files Browse the repository at this point in the history
  • Loading branch information
hekrxe authored and lixiaojiee committed Feb 24, 2019
1 parent 6b589f0 commit e89b3f2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
*
*/
public class CacheListener implements TreeCacheListener {
private static final byte[] EMPTY_BYTES = new byte[0];

private Map<String, Set<ConfigurationListener>> keyListeners = new ConcurrentHashMap<>();
private CountDownLatch initializedLatch;
private String rootPath;
Expand Down Expand Up @@ -83,6 +85,9 @@ public void childEvent(CuratorFramework aClient, TreeCacheEvent event) throws Ex
return;
}

if (value == null) {
value = EMPTY_BYTES;
}
ConfigChangeEvent configChangeEvent = new ConfigChangeEvent(key, new String(value, StandardCharsets.UTF_8), changeType);
Set<ConfigurationListener> listeners = keyListeners.get(key);
if (CollectionUtils.isNotEmpty(listeners)) {
Expand Down

0 comments on commit e89b3f2

Please sign in to comment.