Browse Source

Some null checks

renovate/androidx.fragment-fragment-ktx-1.x
Ammar Githam 3 years ago
parent
commit
6ae5d8bd59
  1. 2
      app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemLinkViewHolder.java

2
app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemLinkViewHolder.java

@ -43,7 +43,9 @@ public class DirectItemLinkViewHolder extends DirectItemViewHolder {
@Override
public void bindItem(final DirectItem item, final MessageDirection messageDirection) {
final DirectItemLink link = item.getLink();
if (link == null) return;
final DirectItemLinkContext linkContext = link.getLinkContext();
if (linkContext == null) return;
final String linkImageUrl = linkContext.getLinkImageUrl();
if (TextUtils.isEmpty(linkImageUrl)) {
binding.preview.setVisibility(View.GONE);

Loading…
Cancel
Save