From c688b5227f614dbd45d3c8c723b9b6b8c0c28a44 Mon Sep 17 00:00:00 2001 From: madoke Date: Mon, 15 Aug 2016 11:41:23 +0100 Subject: [PATCH] fix: prevent possible NPE --- .../com/netflix/config/source/EtcdConfigurationSource.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/archaius-etcd/src/main/java/com/netflix/config/source/EtcdConfigurationSource.java b/archaius-etcd/src/main/java/com/netflix/config/source/EtcdConfigurationSource.java index 631bf6565..3eb0b6ad5 100644 --- a/archaius-etcd/src/main/java/com/netflix/config/source/EtcdConfigurationSource.java +++ b/archaius-etcd/src/main/java/com/netflix/config/source/EtcdConfigurationSource.java @@ -68,6 +68,10 @@ private void init() { } private void cacheValues(Node configNode) { + if(configNode == null || configNode.getNodes() == null) { + return; + } + for (Node valueNode : configNode.getNodes()) { final String etcdKey = valueNode.key(); final String sourceKey = Iterables.getLast(keySplitter.split(etcdKey));