From f1902e82e615c4e4324c03959a40fa21258d8846 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Tue, 8 Sep 2020 11:32:31 -0400 Subject: [PATCH] sorta fix #127 --- .../fragments/directmessages/DirectMessageThreadFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageThreadFragment.java b/app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageThreadFragment.java index bab07098..43becd8b 100644 --- a/app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageThreadFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageThreadFragment.java @@ -284,7 +284,8 @@ public class DirectMessageThreadFragment extends Fragment { sendText(null, directItemModel.getItemId(), directItemModel.isLiked()); } else if (which == 2) { - if (String.valueOf(directItemModel.getUserId()).equals(myId)) new ThreadAction().execute("delete", directItemModel.getItemId()); + if (directItemModel == null) Toast.makeText(requireContext(), R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show(); + else if (String.valueOf(directItemModel.getUserId()).equals(myId)) new ThreadAction().execute("delete", directItemModel.getItemId()); else searchUsername(getUser(directItemModel.getUserId()).getUsername()); } };