Skip to content

Commit 67a81ed

Browse files
committed
A safeguard in case if bridge becomes null, might happen while cyclic pipeline execution.
1 parent 3a48edf commit 67a81ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libs/logstash-bridge/src/main/java/org/elasticsearch/logstashbridge/ingest/ProcessorBridge.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.elasticsearch.logstashbridge.threadpool.ThreadPoolBridge;
2121

2222
import java.util.Map;
23+
import java.util.Objects;
2324
import java.util.function.BiConsumer;
2425

2526
/**
@@ -81,7 +82,10 @@ public String getDescription() {
8182
public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Exception> handler) {
8283
AbstractExternal.this.execute(
8384
IngestDocumentBridge.fromInternalNullable(ingestDocument),
84-
(idb, e) -> handler.accept(idb.toInternal(), e)
85+
(ingestDocumentBridge, e) -> handler.accept(
86+
Objects.isNull(ingestDocumentBridge) ? null : ingestDocumentBridge.toInternal(),
87+
e
88+
)
8589
);
8690
}
8791

0 commit comments

Comments
 (0)