X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fimpl%2Fcodec%2Fxml%2FXmlDocumentUtils.java;h=ca66967f9dc4ac68cad4e737673d4784256daf83;hb=5cd62cd195348cd72e54c16e2aee9d1e30abccb6;hp=63fb0a3772586b0dc9b9f4b6c9d5f509297b71c4;hpb=e64e0fa0c3265814d48640e432336ff5a17ad151;p=yangtools.git diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtils.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtils.java index 63fb0a3772..ca66967f9d 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtils.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtils.java @@ -155,10 +155,13 @@ public class XmlDocumentUtils { element.setAttribute("xmlns:" + prefix, value.getNamespace().toString()); element.setTextContent(prefix + ":" + value.getLocalName()); } else { + Object value = node.getValue(); logger.debug("Value of {}:{} is not instance of QName but is {}", baseType.getQName().getNamespace(), // baseType.getQName().getLocalName(), // - node.getValue().getClass()); - element.setTextContent(String.valueOf(node.getValue())); + node != null ? value.getClass() : "null"); + if (value != null) { + element.setTextContent(String.valueOf(value)); + } } } else { if (node.getValue() != null) {