NullPointerException when trying to list prepared transactions as JSON - part 2

This commit is contained in:
Tom Ross 2015-12-10 11:13:55 +00:00 committed by Clebert Suconic
parent da5c5f7241
commit d7f245f1ca
1 changed files with 16 additions and 2 deletions

View File

@ -872,7 +872,14 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
JSONArray txDetailListJson = new JSONArray();
for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime) {
Xid xid = entry.getKey();
TransactionDetail detail = new CoreTransactionDetail(xid, resourceManager.getTransaction(xid), entry.getValue());
Transaction tx = resourceManager.getTransaction(xid);
if (tx == null) {
continue;
}
TransactionDetail detail = new CoreTransactionDetail(xid, tx, entry.getValue());
txDetailListJson.put(detail.toJSON());
}
@ -908,7 +915,14 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime) {
Xid xid = entry.getKey();
TransactionDetail detail = new CoreTransactionDetail(xid, resourceManager.getTransaction(xid), entry.getValue());
Transaction tx = resourceManager.getTransaction(xid);
if (tx == null) {
continue;
}
TransactionDetail detail = new CoreTransactionDetail(xid, tx, entry.getValue());
JSONObject txJson = detail.toJSON();