diff --git a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java index 13dbcdf..559106d 100644 --- a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java +++ b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java @@ -369,6 +369,9 @@ public class MoGoLiveManager { * 退出房间 */ private void logOutRoom() { + if (mExpressEngine == null) { + return; + } if (!TextUtils.isEmpty(currentRoomId)) { mExpressEngine.logoutRoom(currentRoomId); } @@ -461,7 +464,10 @@ public class MoGoLiveManager { * 停止预览 */ private void stopPreview() { - ZegoExpressEngine.getEngine().stopPreview(); + if(mExpressEngine == null){ + return; + } + mExpressEngine.stopPreview(); } /** @@ -476,8 +482,11 @@ public class MoGoLiveManager { * 停止推送数据 */ private void stopPublishingStream() { + if(mExpressEngine == null){ + return; + } // 停止推送 - ZegoExpressEngine.getEngine().stopPublishingStream(); + mExpressEngine.stopPublishingStream(); } /**