From 5969eec19f9938b166a4db3e35c5bb4059670556 Mon Sep 17 00:00:00 2001 From: Artem Poltorzhitskiy Date: Sun, 5 Nov 2023 14:16:23 +0100 Subject: [PATCH] Fix: check channel message pointer (#30) --- 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).