aldinokemal/go-whatsapp-web-multidevice

Application runtime error with message reaction from WhatsApp client

Closed this issue ยท 2 comments

When a WhatsApp remote client reacts to a message (e.g. "๐Ÿ‘"), I consistently get the following panic:

19:15:16.312 [Client ERROR] Event handler panicked while handling a *events.Message: runtime error: invalid memory address or nil pointer dereference
goroutine 84 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x5e
go.mau.fi/whatsmeow.(*Client).dispatchEvent.func1()
        /root/work/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20231127175850-3c97433b4676/client.go:636 +0x7d
panic({0xc858a0?, 0x13eb130?})
        /usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/whatsapp.forwardToWebhook(0xc0005a2160)
        /opt/go-whatsapp-web-multidevice/src/pkg/whatsapp/whatsapp.go:313 +0x2e8
github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/whatsapp.handler({0xc6fbc0?, 0xc0005a2160?})
        /opt/go-whatsapp-web-multidevice/src/pkg/whatsapp/whatsapp.go:237 +0x18df
go.mau.fi/whatsmeow.(*Client).dispatchEvent(0xc000546000?, {0xc6fbc0, 0xc0005a2160})
        /root/work/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20231127175850-3c97433b4676/client.go:640 +0xcd
go.mau.fi/whatsmeow.(*Client).handleDecryptedMessage(0xc00009dd38?, 0xc000560240, 0xc000558240, 0x0)
        /root/work/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20231127175850-3c97433b4676/message.go:559 +0xe5
go.mau.fi/whatsmeow.(*Client).decryptMessages(0xc000546000, 0xc000560240, 0xc0005b4000)
        /root/work/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20231127175850-3c97433b4676/message.go:225 +0xad1
go.mau.fi/whatsmeow.(*Client).handleEncryptedMessage(0xc000546000, 0xc0005b4000)
        /root/work/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20231127175850-3c97433b4676/message.go:52 +0x3ae
go.mau.fi/whatsmeow.(*Client).handlerQueueLoop.func1()
        /root/work/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20231127175850-3c97433b4676/client.go:587 +0x83
created by go.mau.fi/whatsmeow.(*Client).handlerQueueLoop in goroutine 29
        /root/work/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20231127175850-3c97433b4676/client.go:585 +0x195
reactsuccess2 reactsuccess

it's working using latest version

Fixed here f03e8f1

you can use v4.9.1 up