commit | c33db444604991ac467be13e67f3066450ea7149 | [log] [tgz] |
---|---|---|
author | nitinanand <nitin.anand@samsung.com> | Mon Apr 10 10:45:00 2017 +0530 |
committer | nitinanand <nitin.anand@samsung.com> | Mon Apr 10 10:45:00 2017 +0530 |
tree | fc7630e260c3c39fd2b5803149a80695ee73ad40 | |
parent | b3567288d69079b4eb06cc8326355c9ed290e8d7 [diff] |
[ONOS-6247] Fix for Misplaced null check for YdtContext object Change-Id: I052957b7db9c893d4db4691ebd933c23028b5dab
diff --git a/protocols/restconf/server/utils/src/main/java/org/onosproject/protocol/restconf/server/utils/parser/json/ParserUtils.java b/protocols/restconf/server/utils/src/main/java/org/onosproject/protocol/restconf/server/utils/parser/json/ParserUtils.java index 87a3d51..c00e265 100644 --- a/protocols/restconf/server/utils/src/main/java/org/onosproject/protocol/restconf/server/utils/parser/json/ParserUtils.java +++ b/protocols/restconf/server/utils/src/main/java/org/onosproject/protocol/restconf/server/utils/parser/json/ParserUtils.java
@@ -564,15 +564,16 @@ ydtNode = ydtNode.getFirstChild(); } + if (ydtNode == null) { + // There is no more node to find in YDT + return null; + } + if (((YdtExtendedContext) ydtNode).getYdtContextOperationType() != NONE) { // We found last node break; } - if (ydtNode == null) { - // There is no more node to find in YDT - return null; - } opType = ((YdtExtendedContext) ydtNode).getYdtContextOperationType(); }