fix:修复两处快速切换在线列表导致的空指针问题

This commit is contained in:
zlzw 2022-08-25 16:28:04 +08:00
parent a0169a952d
commit 418be1ec67

View File

@ -272,6 +272,9 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
}
private List<LiveUserGiftBean> processUserData(JSONObject json){
List<LiveUserGiftBean> data = JSON.parseArray(json.getString("userlist"), LiveUserGiftBean.class);
if(data==null){
return new ArrayList<>();
}
Log.i("tag222", "ssss");
if (data.size() > 0 && pg == 1) {
nums = 0;
@ -297,6 +300,9 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
/**
* 由于在线观众和粉丝列表实体结构与榜单结构不一致做个兼容操作
*/
if(rank==null){
return data;
}
for (Object o : rank) {
JSONObject item= (JSONObject) o;
LiveUserRankBean bean=JSON.parseObject(item.getString("userinfo"),LiveUserRankBean.class);