BUG-1601 Fix null pointer in netconf connector for empty schemas node 58/10158/2
authorMaros Marsalek <mmarsale@cisco.com>
Fri, 22 Aug 2014 08:16:50 +0000 (10:16 +0200)
committerMaros Marsalek <mmarsale@cisco.com>
Fri, 22 Aug 2014 11:30:10 +0000 (13:30 +0200)
Change-Id: I501e1fe1b0c1b531af5dc2f6d992a820c8e6a18e
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfStateSchemas.java

index d6bfc0c..23b039c 100644 (file)
@@ -115,6 +115,11 @@ public final class NetconfStateSchemas {
 
         final CompositeNode schemasNode =
                 (CompositeNode) NetconfMessageTransformUtil.findNode(schemasNodeResult.getResult(), DATA_STATE_SCHEMAS_IDENTIFIER);
+        if(schemasNode == null) {
+            logger.warn("{}: Unable to detect available schemas, get to {} was empty", id, STATE_SCHEMAS_IDENTIFIER);
+            return EMPTY;
+        }
+
         return create(id, schemasNode);
     }
 

©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.