diff --git a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java index febf728ae..f96e82ad5 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -1,5 +1,6 @@ package com.yunbao.live.views; +import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.res.Resources; @@ -527,6 +528,11 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX //加入房间成功后可以通过 RCRTCLocalUser 对象发布本地默认音视频流,包括:麦克风采集的音频和摄像头采集的视频。 RCRTCEngine.getInstance().getDefaultVideoStream().setEncoderMirror(true); + if(rtcRoom==null||rtcRoom.getLocalUser()==null){ + ToastUtil.show("开播失败 room为空"); + ((LiveRyAnchorActivity) mContext).endLives(); + return; + } rtcRoom.getLocalUser().publishDefaultLiveStreams(new IRCRTCResultDataCallback() { @Override public void onSuccess(RCRTCLiveInfo rcrtcLiveInfo1) {