From 5e408d3e1a1397d29bb1c224a98dcd9c82017601 Mon Sep 17 00:00:00 2001 From: Artem Date: Sun, 5 Nov 2023 13:43:42 +0100 Subject: [PATCH] Fix: check channel message pointer --- cmd/api/handler/websocket/channel.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/api/handler/websocket/channel.go b/cmd/api/handler/websocket/channel.go index 1831240c..01a63546 100644 --- a/cmd/api/handler/websocket/channel.go +++ b/cmd/api/handler/websocket/channel.go @@ -91,6 +91,10 @@ func (channel *Channel[I, M]) waitMessage(ctx context.Context) { if !ok { return } + if msg == nil { + log.Warn().Str("channel", channel.storageChannelName).Msg("nil message") + continue + } if msg.Channel != channel.storageChannelName { channel.log.Error(). Str("msg", msg.Channel).