Parent context is reset with null value

Change-Id: Ice5f2a447a614587ac4e28b4419582c085f7f077
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java
index 842bca1..48b739e 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java
@@ -1026,7 +1026,10 @@
      */
     public void setParentContext() {
         if (this instanceof SchemaDataNode) {
-            parentContext = getParentSchemaContext(this.getParent());
+            SchemaContext t = getParentSchemaContext(this.getParent());
+            if (t != null) {
+                parentContext = t;
+            }
 
             // As rpc and anydata node is not leaf holder
             if (nodeType != RPC_NODE && nodeType != ANYDATA_NODE) {