From c290203261681ef883c693141aeed6daeeda3fe6 Mon Sep 17 00:00:00 2001 From: Gal Shnapp Date: Tue, 31 Oct 2023 19:43:35 +0200 Subject: [PATCH] fix: verify context nil error on extMsg (#100) --- src/pkg/whatsapp/whatsapp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/whatsapp/whatsapp.go b/src/pkg/whatsapp/whatsapp.go index cd52dca..328105c 100644 --- a/src/pkg/whatsapp/whatsapp.go +++ b/src/pkg/whatsapp/whatsapp.go @@ -293,8 +293,9 @@ func forwardToWebhook(evt *events.Message) error { message.Text = extendedMessage } + var quotedmessage any - if evt.Message.ExtendedTextMessage != nil { + if evt.Message.ExtendedTextMessage != nil && evt.Message.ExtendedTextMessage.ContextInfo != nil { if conversation := evt.Message.ExtendedTextMessage.ContextInfo.QuotedMessage.GetConversation(); conversation != "" { quotedmessage = conversation }