diff options
author | David A. Madore <david+git@madore.org> | 2017-03-12 23:30:40 +0100 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2017-03-12 23:38:55 +0100 |
commit | be69769f56164dd69d35eb9786062319dcddc8d0 (patch) | |
tree | eb3f9d3dc94f8d2770c3c7018925a35364ed7dbc | |
parent | 9c502e090fc42f2a87a406d49a3caeb175f41ffe (diff) | |
download | damlengine-be69769f56164dd69d35eb9786062319dcddc8d0.tar.gz damlengine-be69769f56164dd69d35eb9786062319dcddc8d0.tar.bz2 damlengine-be69769f56164dd69d35eb9786062319dcddc8d0.zip |
Entry's titleXml can be null: we must handle this.
-rw-r--r-- | org/madore/damlengine/TodoWeblogSelectionElement.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/org/madore/damlengine/TodoWeblogSelectionElement.java b/org/madore/damlengine/TodoWeblogSelectionElement.java index 846f1b5..1a342ba 100644 --- a/org/madore/damlengine/TodoWeblogSelectionElement.java +++ b/org/madore/damlengine/TodoWeblogSelectionElement.java @@ -176,6 +176,13 @@ public final class TodoWeblogSelectionElement extends TodoDefaultElement { = (DOMImplementationLS)ctx.doc.getImplementation(); LSParser par = domi.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null); LSInput input = domi.createLSInput(); + if ( esum.titleXml == null ) { + // If there is no title, use number instead. + str = String.format("%04d", ((Context.WeblogSingleSelectionContext)(ctx.wsc)).number); + Node strNode = ctx.doc.createTextNode(str); + span.appendChild(strNode); + break; // Leave now! + } input.setStringData(esum.titleXml); Document temp = par.parse(input); Node titleNode = ctx.doc.adoptNode(temp.getDocumentElement()); |