修复【我的】UserBean.getSlide可能为空导致的闪退问题

This commit is contained in:
zlzw 2023-01-29 10:41:48 +08:00
parent b82c87d5d6
commit bc0e698a77

View File

@ -42,6 +42,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.APKManager; import com.yunbao.common.manager.APKManager;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -282,10 +283,8 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
private void showData(UserBean u, List<UserItemBean> list) { private void showData(UserBean u, List<UserItemBean> list) {
mBannerList.clear(); mBannerList.clear();
mBannerListNew.clear(); mBannerListNew.clear();
if (!u.getSlide().equals("") && u.getSlide() != null) { if (!StringUtil.isEmpty(u.getSlide())) {
mBannerListNew.addAll(JSON.parseArray(u.getSlide(), SlideBean.class)); mBannerListNew.addAll(JSON.parseArray(u.getSlide(), SlideBean.class));
}
if (!u.getSlide().equals("") && null != u.getSlide()) {
for (SlideBean bean : mBannerListNew) { for (SlideBean bean : mBannerListNew) {
if (bean.getSlide_status().equals("1")) { if (bean.getSlide_status().equals("1")) {
mBannerList.add(bean); mBannerList.add(bean);