From 6ae5d8bd59c75df910908be7ff5214e0d935d5ea Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Tue, 13 Jul 2021 21:14:06 +0900 Subject: [PATCH] Some null checks --- .../viewholder/directmessages/DirectItemLinkViewHolder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemLinkViewHolder.java b/app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemLinkViewHolder.java index 98c9fb14..eef9c45f 100644 --- a/app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemLinkViewHolder.java +++ b/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);