mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-04 12:47:46 +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.setTotal(GsonHelper.getInteger(o, "total"));
|
||||||
wxMpUserList.setCount(GsonHelper.getInteger(o, "count"));
|
wxMpUserList.setCount(GsonHelper.getInteger(o, "count"));
|
||||||
wxMpUserList.setNextOpenId(GsonHelper.getString(o, "next_openid"));
|
wxMpUserList.setNextOpenId(GsonHelper.getString(o, "next_openid"));
|
||||||
JsonArray data = o.get("data").getAsJsonObject().get("openid").getAsJsonArray();
|
if (!o.get("data").isJsonNull() && !o.get("data").getAsJsonObject().get("openid").isJsonNull()) {
|
||||||
for (int i = 0; i < data.size(); i++) {
|
JsonArray data = o.get("data").getAsJsonObject().get("openid").getAsJsonArray();
|
||||||
wxMpUserList.getOpenIds().add(GsonHelper.getAsString(data.get(i)));
|
for (int i = 0; i < data.size(); i++) {
|
||||||
|
wxMpUserList.getOpenIds().add(GsonHelper.getAsString(data.get(i)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return wxMpUserList;
|
return wxMpUserList;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user