Resolved problem - schema node was not found for XML translation
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / codec / xml / XmlDocumentUtils.java
index 2fb4a44c8a573dcc0a95ff500a8168b9e0147e42..87a6181b525a8a93b14c51a5f488db0e91daea79 100644 (file)
@@ -363,7 +363,7 @@ public class XmlDocumentUtils {
                 } else if (dsn instanceof ChoiceNode) {
                     for (ChoiceCaseNode choiceCase : ((ChoiceNode) dsn).getCases()) {
                         Optional<DataSchemaNode> foundDsn = findFirstSchema(qname, choiceCase.getChildNodes());
-                        if (foundDsn != null) {
+                        if (foundDsn != null && foundDsn.isPresent()) {
                             return foundDsn;
                         }
                     }