From de6306c78128327ff56474c8d1112883a4e94fbd Mon Sep 17 00:00:00 2001 From: KirillPamPam Date: Wed, 20 Dec 2023 14:01:34 +0400 Subject: [PATCH] Check if currentSpan is not null (#368) --- src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt index 08a1fcf6..32e41bf1 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/BlockchainRpc.kt @@ -100,7 +100,9 @@ class BlockchainRpc( }.doOnError { failMetric.increment() }.doFinally { - providerSpanHandler?.sendSpans(tracer.currentSpan().context()) + tracer.currentSpan()?.run { + providerSpanHandler?.sendSpans(this.context()) + } } }