Skip to content

Commit

Permalink
Don't attempt to write a null message
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Apr 14, 2016
1 parent 3510f54 commit 20e41ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/xmlcalabash/runtime/XTry.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public void run() throws SaxonApiException {
// Hey, no one reported this exception. We better do it. // Hey, no one reported this exception. We better do it.
treeWriter.addStartElement(c_error); treeWriter.addStartElement(c_error);


String message = xe.getMessage();
StructuredQName qCode = null; StructuredQName qCode = null;
String message = xe.getMessage();


if (xe instanceof XPathException) { if (xe instanceof XPathException) {
XPathException xxx = (XPathException) xe; XPathException xxx = (XPathException) xe;
Expand Down Expand Up @@ -162,6 +162,10 @@ public void run() throws SaxonApiException {
} }
} }


if (message == null) {
message = "";
}

treeWriter.startContent(); treeWriter.startContent();
treeWriter.addText(message); treeWriter.addText(message);
treeWriter.addEndElement(); treeWriter.addEndElement();
Expand Down

0 comments on commit 20e41ea

Please sign in to comment.