NullPointerException when trying to list prepared transactions as JSON
This commit is contained in:
parent
a95784096d
commit
f29ab83727
|
@ -72,7 +72,13 @@ public abstract class TransactionDetail {
|
||||||
detailJson.put(KEY_XID_BRANCH_QUAL, new String(this.xid.getBranchQualifier()));
|
detailJson.put(KEY_XID_BRANCH_QUAL, new String(this.xid.getBranchQualifier()));
|
||||||
|
|
||||||
JSONArray msgsJson = new JSONArray();
|
JSONArray msgsJson = new JSONArray();
|
||||||
List<TransactionOperation> txops = this.transaction.getAllOperations();
|
|
||||||
|
List<TransactionOperation> txops = null;
|
||||||
|
|
||||||
|
if (this.transaction != null) {
|
||||||
|
txops = this.transaction.getAllOperations();
|
||||||
|
}
|
||||||
|
|
||||||
detailJson.put(KEY_TX_RELATED_MESSAGES, msgsJson);
|
detailJson.put(KEY_TX_RELATED_MESSAGES, msgsJson);
|
||||||
if (txops == null) {
|
if (txops == null) {
|
||||||
return detailJson;
|
return detailJson;
|
||||||
|
|
|
@ -392,7 +392,13 @@ public class TransactionImpl implements Transaction {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized List<TransactionOperation> getAllOperations() {
|
public synchronized List<TransactionOperation> getAllOperations() {
|
||||||
return new ArrayList<TransactionOperation>(operations);
|
|
||||||
|
if (operations != null) {
|
||||||
|
return new ArrayList<TransactionOperation>(operations);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return new ArrayList<TransactionOperation>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue