Skip to content

Commit 196c690

Browse files
Handle non-filled PubSub.
1 parent 19b46a2 commit 196c690

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/gcp/services.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ func DiscoverServices(project, serviceName string, tracerProviderOptions []sdktr
149149
// Does **not** handle errors in close since there usually
150150
// is not much that can be done on Close failure anyway.
151151
func (s *Services) Close() {
152-
s.PubSub.Close()
152+
if s.PubSub != nil {
153+
s.PubSub.Close()
154+
}
153155
s.TracerProvider.ForceFlush(context.Background()) // flushes any pending spans
154156
s.ErrorReporting.Close()
155157
s.Logging.Close()

0 commit comments

Comments
 (0)