mirror of https://github.com/apache/activemq.git
[AMQ-7424] Prevent NPE during commitRemove() on JDBC adapter
This commit is contained in:
parent
6e650841fd
commit
d8ae8734a9
|
@ -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