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

查询取消关注的用户会导致公众号中UserService的userInfo抛出NPE #480

Closed
ftong2010 opened this issue Mar 5, 2018 · 3 comments
Labels

Comments

@ftong2010
Copy link

在查询用户信息时,如果一个用户已经取消关注公众号,那么只能拿到openID和其他的辅助信息。在WxMpUserGsonAdapter中,代码段

 switch (sex) {
      case 1:
        user.setSexDesc("男");
        break;
      case 2:
        user.setSexDesc("女");
        break;
      default:
        user.setSexDesc("未知");
    }

会因为获取不到sex字段而导致抛出NPE异常

@ftong2010
Copy link
Author

使用的版本是2.9.6.BETA

@binarywang
Copy link
Owner

感谢提出问题,之后修复下

@binarywang
Copy link
Owner

2.9.8.BETA版本已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants