Skip to content

Commit

Permalink
ARTEMIS-4734 mitigate NPE in ReplicationManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jbertram committed Apr 22, 2024
1 parent 86f7250 commit c2acfc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ private OperationContext sendReplicatePacket(final Packet packet, boolean lineUp
}

final OperationContext repliToken = OperationContextImpl.getContext(ioExecutorFactory);
if (repliToken == null) {
throw ActiveMQMessageBundle.BUNDLE.replicationFailureRepliTokenNull(packet.toString(), ioExecutorFactory.toString());
}
if (lineUp) {
repliToken.replicationLineUp();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,4 +548,7 @@ IllegalStateException invalidRoutingTypeUpdate(String queueName,

@Message(id = 229252, value = "Invalid HAPolicy property: {}")
RuntimeException unsupportedHAPolicyPropertyType(String invalidHAPolicy);

@Message(id = 229253, value = "Unable to acquire OperationContext when replicating packet: {}. ExecutorFactory: {}")
IllegalStateException replicationFailureRepliTokenNull(String packet, String executorFactory);
}

0 comments on commit c2acfc6

Please sign in to comment.