From 39a7a0b5716ea78c7eddae155a5c6bf9d1c49e33 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 26 Jul 2024 19:06:51 -0400 Subject: [PATCH] Add null check Signed-off-by: Craig Perkins --- .../support/replication/TransportReplicationAction.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java index 704c5883c2e34..c23d5ca8907e3 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java @@ -241,7 +241,9 @@ protected TransportReplicationAction( ) { super(actionName, actionFilters, transportService.getTaskManager()); this.threadPool = threadPool; - this.tcWrapper = InternalThreadContextWrapper.from(threadPool.getThreadContext()); + if (threadPool != null) { + this.tcWrapper = InternalThreadContextWrapper.from(threadPool.getThreadContext()); + } this.transportService = transportService; this.clusterService = clusterService; this.indicesService = indicesService;