From: Tony Tkacik Date: Wed, 19 Feb 2014 15:29:03 +0000 (+0000) Subject: Merge "bug 433 NPE in onGlobalContextUpdated of ControllerContext class" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~402 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=f04d241578740473fc8b9f17fe38db6f8ea17f02;hp=c05e8241fcef668a8d2fe00776839df56187a401 Merge "bug 433 NPE in onGlobalContextUpdated of ControllerContext class" --- diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend index f1d412cdb0..482dcf8e8b 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend @@ -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); + } } }