[AMQ-8395] Avoid possible NPE when sending advisory message

(cherry picked from commit f74992c105)
This commit is contained in:
Jean-Baptiste Onofré 2021-10-04 10:14:32 +02:00
parent 0476091fee
commit 57b1316d21
1 changed files with 1 additions and 1 deletions

View File

@ -540,7 +540,7 @@ public class Topic extends BaseDestination implements Task {
message.incrementReferenceCount();
if (context.isInTransaction()) {
if (context.isInTransaction() && (context.getTransaction() != null)) {
context.getTransaction().addSynchronization(new Synchronization() {
@Override
public void afterCommit() throws Exception {