mirror of https://github.com/apache/activemq.git
Merge pull request #481 from jbonofre/AMQ-7424
[AMQ-7424] Prevent NPE during commitRemove() on JDBC adapter
This commit is contained in:
commit
80d06fc186
|
@ -800,7 +800,9 @@ public class JDBCPersistenceAdapter extends DataSourceServiceSupport implements
|
|||
public void commitRemove(ConnectionContext context, MessageAck ack) throws IOException {
|
||||
TransactionContext c = getTransactionContext(context);
|
||||
try {
|
||||
getAdapter().doRemoveMessage(c, (Long)ack.getLastMessageId().getEntryLocator(), null);
|
||||
if (c != null && ack != null && ack.getLastMessageId() != null && ack.getLastMessageId().getEntryLocator() != null) {
|
||||
getAdapter().doRemoveMessage(c, (Long) ack.getLastMessageId().getEntryLocator(), null);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
JDBCPersistenceAdapter.log("JDBC Failure: ", e);
|
||||
throw IOExceptionSupport.create("Failed to commit last ack: " + ack + ". Reason: " + e,e);
|
||||
|
|
Loading…
Reference in New Issue