ARTEMIS-4734 mitigate NPE in ReplicationManager

This commit is contained in:
Justin Bertram 2024-04-22 13:07:07 -05:00
parent 379515382e
commit 934fe24e5c
2 changed files with 6 additions and 0 deletions

View File

@ -462,6 +462,9 @@ public final class ReplicationManager implements ActiveMQComponent {
} }
final OperationContext repliToken = OperationContextImpl.getContext(ioExecutorFactory); final OperationContext repliToken = OperationContextImpl.getContext(ioExecutorFactory);
if (repliToken == null) {
throw ActiveMQMessageBundle.BUNDLE.replicationFailureRepliTokenNull(packet.toString(), ioExecutorFactory.toString());
}
if (lineUp) { if (lineUp) {
repliToken.replicationLineUp(); repliToken.replicationLineUp();
} }

View File

@ -548,4 +548,7 @@ public interface ActiveMQMessageBundle {
@Message(id = 229252, value = "Invalid HAPolicy property: {}") @Message(id = 229252, value = "Invalid HAPolicy property: {}")
RuntimeException unsupportedHAPolicyPropertyType(String invalidHAPolicy); RuntimeException unsupportedHAPolicyPropertyType(String invalidHAPolicy);
@Message(id = 229253, value = "Unable to acquire OperationContext when replicating packet: {}. ExecutorFactory: {}")
IllegalStateException replicationFailureRepliTokenNull(String packet, String executorFactory);
} }