Merge "bug 433 NPE in onGlobalContextUpdated of ControllerContext class"
authorTony Tkacik <ttkacik@cisco.com>
Wed, 19 Feb 2014 15:29:03 +0000 (15:29 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 19 Feb 2014 15:29:03 +0000 (15:29 +0000)
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend

index f1d412c..482dcf8 100644 (file)
@@ -603,10 +603,13 @@ class ControllerContext implements SchemaServiceListener {
     }
 
     override onGlobalContextUpdated(SchemaContext context) {
-        this.globalSchema = context;
-        for (operation : context.operations) {
-            val qname = operation.QName;
-            qnameToRpc.put(qname, operation);
+        if (context !== null) {
+            qnameToRpc.clear
+            this.globalSchema = context;
+            for (operation : context.operations) {
+                val qname = operation.QName;
+                qnameToRpc.put(qname, operation);
+            }
         }
     }