Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【BUG】空指针引用错误,新成员附加个人介绍进群时可复现 #638

Closed
LennyDream opened this issue Feb 14, 2021 · 2 comments
Labels
bug Something isn't working need more info  需要更多信息

Comments

@LennyDream
Copy link

环境信息:
go-cqhttp版本: go-cqhttp-v0.9.40
运行环境: windows_amd64
连接方式: 反向WS

BUG内容:
问题重现:当新的成员申请加群,附加"个人介绍"的时候;进群则会发一条个人介绍消息,这时找不到该群成员导致空指针错误

// bot.go:411 
mem := bot.Client.FindGroup(m.GroupCode).FindMember(m.Sender.Uin)

空指针
event error: runtime error: invalid memory address or nil pointer dereference
goroutine 2605 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
E:/GoSDK/go1.15/src/runtime/debug/stack.go:24 +0xac
github.com/Mrs4s/MiraiGo/client.cover.func1()
E:/GoSDK/gopath/pkg/mod/github.com/!mrs4s/!mirai![email protected]/client/events.go:421 +0x6f
panic(0x1ab5aa0, 0x21ae300)
E:/GoSDK/go1.15/src/runtime/panic.go:975 +0x414
github.com/Mrs4s/go-cqhttp/coolq.(*CQBot).formatGroupMessage.func1(0x0, 0x0, 0x0)
E:/Code/02Go/01qqrobot/go-cqhttp-master/coolq/bot.go:414 +0x1b
github.com/Mrs4s/go-cqhttp/coolq.(*CQBot).formatGroupMessage(0xc000038f00, 0xc0004cb720, 0x0)
E:/Code/02Go/01qqrobot/go-cqhttp-master/coolq/bot.go:422 +0x13de
github.com/Mrs4s/go-cqhttp/coolq.(*CQBot).groupMessageEvent(0xc000038f00, 0xc000077c00, 0xc0004cb720)
E:/Code/02Go/01qqrobot/go-cqhttp-master/coolq/event.go:96 +0x12a5
github.com/Mrs4s/MiraiGo/client.(*QQClient).dispatchGroupMessage.func1()
E:/GoSDK/gopath/pkg/mod/github.com/!mrs4s/!mirai![email protected]/client/events.go:186 +0x5a
github.com/Mrs4s/MiraiGo/client.cover(0xc0007c9be8)
E:/GoSDK/gopath/pkg/mod/github.com/!mrs4s/!mirai![email protected]/client/events.go:424 +0x56
github.com/Mrs4s/MiraiGo/client.(*QQClient).dispatchGroupMessage(0xc000077c00, 0xc0004cb720)
E:/GoSDK/gopath/pkg/mod/github.com/!mrs4s/!mirai![email protected]/client/events.go:185 +0x105
github.com/Mrs4s/MiraiGo/client.decodeGroupMessagePacket(0xc000077c00, 0xc0004666b4, 0xc000798000, 0x228, 0x228, 0x0, 0x0, 0x0, 0x0)
E:/GoSDK/gopath/pkg/mod/github.com/!mrs4s/!mirai![email protected]/client/group_msg.go:337 +0x7f1
github.com/Mrs4s/MiraiGo/client.(*QQClient).netLoop.func2(0xc000077c00, 0xc000a15090, 0xc000798000, 0x228, 0x228)
E:/GoSDK/gopath/pkg/mod/github.com/!mrs4s/!mirai![email protected]/client/client.go:910 +0x19d
created by github.com/Mrs4s/MiraiGo/client.(*QQClient).netLoop
E:/GoSDK/gopath/pkg/mod/github.com/!mrs4s/!mirai![email protected]/client/client.go:901 +0xed0

@Mrs4s Mrs4s added the bug Something isn't working label Feb 14, 2021
Mrs4s added a commit that referenced this issue Feb 17, 2021
@wfjsw
Copy link
Collaborator

wfjsw commented Feb 17, 2021

无法本地复现。请提供发生错误前后至少1分钟的调试日志,并描述错误发生前后你的所有操作。

@Mrs4s Mrs4s added the need more info  需要更多信息 label Feb 19, 2021
@Mrs4s
Copy link
Owner

Mrs4s commented Feb 19, 2021

尝试复现失败, 暂时合了个临时解决方案, 需要更多信息

@Mrs4s Mrs4s closed this as completed in 569a718 Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info  需要更多信息
Projects
None yet
Development

No branches or pull requests

3 participants