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

Senparc.Weixin.MP.Entities.RequestMessageEventBase继承错误 #45

Closed
mayswind opened this issue Aug 22, 2014 · 3 comments
Closed

Senparc.Weixin.MP.Entities.RequestMessageEventBase继承错误 #45

mayswind opened this issue Aug 22, 2014 · 3 comments

Comments

@mayswind
Copy link

Senparc.Weixin.MP.Entities.RequestMessageEventBase继承自RequestMessageBase和IRequestMessageBase,当RequestMessageFactory创建RequestMessage为RequestMessageEventBase类型时(如微博的follow和unfollow),并不继承自IRequestMessageEventBase。
所以当执行MessageHandler的Execute()方法时,在var requestMessageText = (RequestMessage as IRequestMessageEventBase).ConvertToRequestMessageText();这一句中,ConvertToRequestMessageText(IRequestMessageEventBase requestMessageEvent)中获取到的requestMessageEvent是null,导致之后会抛空异常错误。根据继承关系和类名来看,RequestMessageEventBase应该继承自RequestMessageBase和IRequestMessageEventBase。

@JeffreySu
Copy link
Owner

你好,总体看了一下,问题应该是:RequestMessageEventBase继承了IRequestMessageBase接口,实际上应该是IRequestMessageEventBase。对吧?已经在v7.0.18里面修正。谢谢!

@mayswind
Copy link
Author

这次就对了呢

@JeffreySu
Copy link
Owner

是的,应该就是这里的问题,非常感谢!欢迎继续沟通:)

JeffreySu pushed a commit that referenced this issue Jun 9, 2020
JeffreySu pushed a commit that referenced this issue May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants