summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2017-03-12 23:30:40 +0100
committerDavid A. Madore <david+git@madore.org>2017-03-12 23:38:55 +0100
commitbe69769f56164dd69d35eb9786062319dcddc8d0 (patch)
treeeb3f9d3dc94f8d2770c3c7018925a35364ed7dbc
parent9c502e090fc42f2a87a406d49a3caeb175f41ffe (diff)
downloaddamlengine-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.java7
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());