diff --git a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java index c66f2a0d0..298edf6ed 100644 --- a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java +++ b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java @@ -77,7 +77,8 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder { String link = bean.getSlideUrl(); if (link.contains("http")) { WebViewActivity.forward(itemView.getContext(), link, true); - mShowLoadingDialog.dismiss(); + if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing()) + mShowLoadingDialog.dismiss(); } else { gotoLive(link, bean.getType()); } @@ -99,7 +100,8 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder { LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(itemView.getContext(), (liveBean1, liveType, liveTypeVal, liveSdk) -> { if (liveBean1 == null) { - mShowLoadingDialog.dismiss(); + if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing()) + mShowLoadingDialog.dismiss(); return; } Map map = null; @@ -108,13 +110,15 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder { map.put("OPEN", "NEWUSER"); } LiveAudienceActivity.forward(itemView.getContext(), liveBean1, liveType, liveTypeVal, "", map, 0, liveSdk); - mShowLoadingDialog.dismiss(); + if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing()) + mShowLoadingDialog.dismiss(); ((Activity) itemView.getContext()).finish(); }); mCheckLivePresenter.checkLive(liveBean); } else { - mShowLoadingDialog.dismiss(); + if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing()) + mShowLoadingDialog.dismiss(); RouteUtil.forwardUserHome(itemView.getContext(), liveId, 0); ((Activity) itemView.getContext()).finish(); }