openimsdk / open-im-server

IM Chat ChatGPT
https://openim.io
Apache License 2.0
14.09k stars 2.48k forks source link

Bug: Jpush return a nil pointer panic #984

Closed xupin1026 closed 1 year ago

xupin1026 commented 1 year ago

What happened?

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x10d5d32] goroutine 89 [running]: github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/jpush.(JPush).Push(0x3?, {0x16f0d58, 0xc000533cb0}, {0xc000192920, 0x2, 0x2}, {0x148523e, 0x8}, {0x148523e, 0x8}, ...) /openim/openim-server/internal/push/offlinepush/jpush/push.go:56 +0x152 github.com/OpenIMSDK/Open-IM-Server/internal/push.(Pusher).offlinePushMsg(0xc00057c1e0, {0x16f0d58, 0xc000533cb0}, {0xc000abfdec?, 0xb?}, 0xc0002e2280?, {0xc000192920, 0x2, 0x2}) /openim/openim-server/internal/push/push_to_client.go:281 +0xbb github.com/OpenIMSDK/Open-IM-Server/internal/push.(Pusher).Push2User(0xc00057c1e0, {0x16f0d58, 0xc000533cb0}, {0xc000192920?, 0x2, 0x2}, 0xc0002b0780) /openim/openim-server/internal/push/push_to_client.go:121 +0x6d3 github.com/OpenIMSDK/Open-IM-Server/internal/push.(ConsumerHandler).handleMs2PsChat(0xc0002e8888, {0x16f0d58, 0xc000533cb0}, {0xc0000dc78f, 0x193, 0x2d3}) /openim/openim-server/internal/push/push_handler.go:75 +0x355 github.com/OpenIMSDK/Open-IM-Server/internal/push.(ConsumerHandler).ConsumeClaim(0xc0002e8888, {0x16f6cc8, 0xc0000ed200}, {0x16f1de0?, 0xc000657800?}) /openim/openim-server/internal/push/push_handler.go:92 +0x91 github.com/Shopify/sarama.(consumerGroupSession).consume(0xc0000ed200, {0xc0002e4300, 0x9}, 0x0) /go/pkg/mod/github.com/!shopify/sarama@v1.29.0/consumer_group.go:690 +0x262 github.com/Shopify/sarama.newConsumerGroupSession.func2({0xc0002e4300?, 0x0?}, 0x0?) /go/pkg/mod/github.com/!shopify/sarama@v1.29.0/consumer_group.go:615 +0x76 created by github.com/Shopify/sarama.newConsumerGroupSession /go/pkg/mod/github.com/!shopify/sarama@v1.29.0/consumer_group.go:607 +0x4b1

What did you expect to happen?

no panic

How can we reproduce it (as minimally and precisely as possible)?

use jpush and turn on offline push

Anything else we need to know?

No response

version

release3.2 can reproduce this bug

Cloud provider

none

OS version

No response

Install tools

openimbot commented 1 year ago

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

Join slack 🤖 to connect and communicate with our developers.