From be69769f56164dd69d35eb9786062319dcddc8d0 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sun, 12 Mar 2017 23:30:40 +0100 Subject: Entry's titleXml can be null: we must handle this. --- org/madore/damlengine/TodoWeblogSelectionElement.java | 7 +++++++ 1 file changed, 7 insertions(+) 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()); -- cgit v1.2.3