Permalink
Browse files

Protect against NPE when the error that p:catch catches doesn't suppl…

…y an error code
  • Loading branch information...
ndw committed Feb 15, 2014
1 parent bac278c commit bade43fdca9a2ed28f435ca8002e63565a3678a2
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/com/xmlcalabash/runtime/XTry.java
@@ -132,12 +132,14 @@ public void run() throws SaxonApiException {
if (xe instanceof XProcException) {
XProcException xxx = (XProcException) xe;
QName code = xxx.getErrorCode();
- qCode = new StructuredQName(code.getPrefix(), code.getNamespaceURI(), code.getLocalName());
message = xxx.getMessage();
Throwable underlying = xe.getCause();
if (underlying != null) {
message = underlying.getMessage();
}
+ if (code != null) {
+ qCode = new StructuredQName(code.getPrefix(), code.getNamespaceURI(), code.getLocalName());
+ }
}
if (qCode != null) {

0 comments on commit bade43f

Please sign in to comment.