More netconf-topology module unit tests
[netconf.git] / netconf / netconf-topology / src / main / java / org / opendaylight / netconf / topology / pipeline / tx / ProxyReadOnlyTransaction.java
index c67673b05b99d4e583a0485ca3d26af3363c9e75..a093e1cc8d68a7c15b4bdcbe2f03586fdec955d5 100644 (file)
@@ -58,13 +58,17 @@ public class ProxyReadOnlyTransaction implements DOMDataReadOnlyTransaction{
             @Override
             public void onComplete(Throwable throwable, Optional<NormalizedNodeMessage> normalizedNodeMessage) throws Throwable {
                 if (throwable == null) {
-                    settableFuture.set(normalizedNodeMessage.transform(new Function<NormalizedNodeMessage, NormalizedNode<?, ?>>() {
-                        @Nullable
-                        @Override
-                        public NormalizedNode<?, ?> apply(NormalizedNodeMessage input) {
-                            return input.getNode();
-                        }
-                    }));
+                    if (normalizedNodeMessage.isPresent()) {
+                        settableFuture.set(normalizedNodeMessage.transform(new Function<NormalizedNodeMessage, NormalizedNode<?, ?>>() {
+                            @Nullable
+                            @Override
+                            public NormalizedNode<?, ?> apply(NormalizedNodeMessage input) {
+                                return input.getNode();
+                            }
+                        }));
+                    } else {
+                        settableFuture.set(Optional.absent());
+                    }
                 } else {
                     settableFuture.setException(throwable);
                 }