修复userlist可能为空的问题

This commit is contained in:
zlzw 2024-06-11 17:03:13 +08:00
parent 07d6b959d5
commit 6eba9558e1

View File

@ -697,7 +697,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
if (mLivePlayViewHolder != null && data.getEnterRoomInfo().getIsconnection() != null && data.getEnterRoomInfo().getIsconnection().equals("1")) {
JSONArray array = pkInfo.getJSONArray("userlist");
//判断是否是多人连麦
if (array.size() > 0) {//多人連麥
if (array!=null&& !array.isEmpty()) {//多人連麥
if (mLivePlayViewHolder != null) {
List<DrPkbean> drPkbeans = new ArrayList<>();
for (int j = 0; j < array.size(); j++) {
@ -783,6 +783,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
if (mLivePlayViewHolder != null) {
JSONArray array = pkInfo.getJSONArray("userlist");
if(array==null){
array=new JSONArray();
}
List<DrPkbean> drPkbeans = new ArrayList<>();
for (int j = 0; j < array.size(); j++) {
UserBean userBean = new UserBean();
@ -2379,7 +2382,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
* @param time
*/
public void upDataPkScore(JSONArray pkScores, int time) {
L.eSw("upDataPkScore" + time);
L.eSw("upDataPkScore" + time+"|"+pkScores);
if(pkScores==null){
return;
}
this.pkScores = pkScores;
if (mLiveRoomViewHolder != null) {
String liveId = mLiveBean.getUid();