[Minor] caught an NPE when the Transaction fails but no cause is set

This commit is contained in:
Robert von Burg 2013-12-22 23:03:14 +01:00
parent 6bff06669f
commit 6305bdc69f
1 changed files with 3 additions and 1 deletions

View File

@ -283,7 +283,9 @@ public class DefaultPersistenceTransaction implements PersistenceTransaction {
if (this.txResult.getState() == TransactionState.FAILED) {
String msg = "Failed to commit TX due to underlying exception: {0}"; //$NON-NLS-1$
msg = MessageFormat.format(msg, this.txResult.getFailCause().getMessage());
String causeMsg = this.txResult.getFailCause() == null ? null : this.txResult.getFailCause()
.getMessage();
msg = MessageFormat.format(msg, causeMsg);
throw new XmlPersistenceException(msg, this.txResult.getFailCause());
}
}