修复IM消息获取getUserBean.getId()为空导致的问题

This commit is contained in:
zlzw 2022-11-28 16:29:49 +08:00
parent 718d4a5d2f
commit 23be58c4e8

View File

@ -130,17 +130,22 @@ public class SocketRyClient {
if (mListener == null) { if (mListener == null) {
return; return;
} }
switch (msg.what) { try {
case Constants.SOCKET_WHAT_CONN: switch (msg.what) {
mListener.onConnect((Boolean) msg.obj); case Constants.SOCKET_WHAT_CONN:
break; mListener.onConnect((Boolean) msg.obj);
case Constants.SOCKET_WHAT_BROADCAST: break;
processBroadcast((String) msg.obj); case Constants.SOCKET_WHAT_BROADCAST:
break; processBroadcast((String) msg.obj);
case Constants.SOCKET_WHAT_DISCONN: break;
mListener.onDisConnect(); case Constants.SOCKET_WHAT_DISCONN:
break; mListener.onDisConnect();
break;
}
} catch (Exception e) {
e.printStackTrace();
} }
} }
@ -211,7 +216,7 @@ public class SocketRyClient {
break; break;
} }
UserBean us = CommonAppConfig.getInstance().getUserBean(); UserBean us = CommonAppConfig.getInstance().getUserBean();
if (map.getString("uid") != null && map.getString("uid").equals(us.getId())) { if (map.getString("uid") != null && us != null && map.getString("uid").equals(us.getId())) {
int num = LiveAudienceActivity.fansNum + 1; int num = LiveAudienceActivity.fansNum + 1;
LiveRoomViewHolder.setFansNum(num); LiveRoomViewHolder.setFansNum(num);
} }