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

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

View File

@ -130,6 +130,7 @@ public class SocketRyClient {
if (mListener == null) { if (mListener == null) {
return; return;
} }
try {
switch (msg.what) { switch (msg.what) {
case Constants.SOCKET_WHAT_CONN: case Constants.SOCKET_WHAT_CONN:
mListener.onConnect((Boolean) msg.obj); mListener.onConnect((Boolean) msg.obj);
@ -141,6 +142,10 @@ public class SocketRyClient {
mListener.onDisConnect(); mListener.onDisConnect();
break; 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);
} }