From 81f2b5fd1582434a8accde0cab16279416f4d68d Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Thu, 4 May 2023 19:35:07 +0200 Subject: [PATCH] check that metric is using --- commonspace/space.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commonspace/space.go b/commonspace/space.go index 77b3dc4b..4997cc56 100644 --- a/commonspace/space.go +++ b/commonspace/space.go @@ -408,6 +408,9 @@ func (s *space) handleMessage(msg HandleMessage) { ctx := peer.CtxWithPeerId(context.Background(), msg.SenderId) ctx = logger.CtxWithFields(ctx, zap.Uint64("msgId", msg.Id), zap.String("senderId", msg.SenderId)) defer func() { + if s.metric == nil { + return + } s.metric.RequestLog(msg.PeerCtx, "space.streamOp", msg.LogFields( zap.Error(err), )...)