mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-24 18:04:38 +08:00
issue #95 获取关注者列表userList方法,当没有关注者时,报异常
This commit is contained in:
parent
4740f1f37b
commit
3ae057af8f
@ -22,9 +22,11 @@ public class WxUserListGsonAdapter implements JsonDeserializer<WxMpUserList> {
|
||||
wxMpUserList.setTotal(GsonHelper.getInteger(o, "total"));
|
||||
wxMpUserList.setCount(GsonHelper.getInteger(o, "count"));
|
||||
wxMpUserList.setNextOpenId(GsonHelper.getString(o, "next_openid"));
|
||||
JsonArray data = o.get("data").getAsJsonObject().get("openid").getAsJsonArray();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
wxMpUserList.getOpenIds().add(GsonHelper.getAsString(data.get(i)));
|
||||
if (!o.get("data").isJsonNull() && !o.get("data").getAsJsonObject().get("openid").isJsonNull()) {
|
||||
JsonArray data = o.get("data").getAsJsonObject().get("openid").getAsJsonArray();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
wxMpUserList.getOpenIds().add(GsonHelper.getAsString(data.get(i)));
|
||||
}
|
||||
}
|
||||
return wxMpUserList;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user