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 f1d412cdb0082960aa02f93dcffbc3b5ba0ca6e3..482dcf8e8b37e5427c2470122bae9a15e3189a84 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);
+            }
         }
     }