From a918d4fd02b8365492c62346b418d90246d20c03 Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Wed, 24 Apr 2024 16:17:21 +0200 Subject: [PATCH] fix returning a valid interface when underlying implementation is nil --- state/global.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/state/global.go b/state/global.go index 258c9f7..bac9409 100644 --- a/state/global.go +++ b/state/global.go @@ -19,6 +19,9 @@ func GlobalState() OTEL { otelStateMutex.RLock() s := otelState otelStateMutex.RUnlock() + if s == nil { + return nil + } return s }