Merge "Bug 849: Fixed NPE in Translated Data Change Events."
authorGiovanni Meo <gmeo@cisco.com>
Mon, 12 May 2014 11:05:43 +0000 (11:05 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 12 May 2014 11:05:43 +0000 (11:05 +0000)
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedDataBroker.java

index fa48416..5155e42 100644 (file)
@@ -207,7 +207,11 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         @Override
         public DataObject getOriginalSubtree() {
             if (originalDataCache == null) {
-                originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                if(domEvent.getOriginalSubtree() != null) {
+                    originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                } else {
+                    originalDataCache = Optional.absent();
+                }
             }
             return originalDataCache.orNull();
         }
@@ -215,9 +219,12 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         @Override
         public DataObject getUpdatedSubtree() {
             if (updatedDataCache == null) {
-                updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                if(domEvent.getUpdatedSubtree() != null) {
+                    updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                } else {
+                    updatedDataCache = Optional.absent();
+                }
             }
-
             return updatedDataCache.orNull();
         }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.