This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq.git
The following commit(s) were added to refs/heads/main by this push:
new f74992c [AMQ-8395] Avoid possible NPE when sending advisory message
new 9431585 Merge pull request #719 from jbonofre/AMQ-8395
f74992c is described below
commit f74992c1058eb8de051c1ce0779ba4f34ba39ed3
Author: Jean-Baptiste Onofré <[email protected]>
AuthorDate: Mon Oct 4 10:14:32 2021 +0200
[AMQ-8395] Avoid possible NPE when sending advisory message
---
.../src/main/java/org/apache/activemq/broker/region/Topic.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
index 12ae5b7..c1078e3 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
@@ -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 {