From 718d4a5d2f0e08f5ec10dc36811af4873a0fc1a7 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Mon, 28 Nov 2022 16:29:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=98=9F=E7=BA=A7=E6=8C=91?= =?UTF-8?q?=E6=88=98data.getImageUrl()=E4=B8=BA=E7=A9=BA=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/views/CustomViewHolder.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/CustomViewHolder.java b/live/src/main/java/com/yunbao/live/views/CustomViewHolder.java index 766aef76d..085d8de5a 100644 --- a/live/src/main/java/com/yunbao/live/views/CustomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/CustomViewHolder.java @@ -11,6 +11,7 @@ import android.widget.TextView; import com.bumptech.glide.Glide; import com.ms.banner.holder.BannerViewHolder; import com.yunbao.common.bean.BannerBean; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.views.weight.ProgressView; import com.yunbao.live.R; @@ -63,9 +64,11 @@ public class CustomViewHolder implements BannerViewHolder { currentAssist.setText(String.valueOf(currentAssistNum)); title.setText(String.format(context.getString(R.string.star_change),data.getModel().getTaskNum())); } else { - String imagerUrl = data.getImageUrl().replace("qny", "downs"); - Glide.with(context).load(imagerUrl).into(bannerBack); - startContext.setVisibility(View.GONE); + if(data!=null&&!StringUtil.isEmpty(data.getImageUrl())) { + String imagerUrl = data.getImageUrl().replace("qny", "downs"); + Glide.with(context).load(imagerUrl).into(bannerBack); + startContext.setVisibility(View.GONE); + } } return contextView;