From e0020e3cf21abe06ca5e6f6456451ccf7b9fd3d1 Mon Sep 17 00:00:00 2001 From: Hermes Junior Date: Fri, 12 Jun 2020 17:18:40 +0200 Subject: [PATCH] Fix crash for non selftext posts. --- .../infinityforreddit/Activity/ViewPostDetailActivity.java | 2 +- .../BottomSheetFragment/CommentMoreBottomSheetFragment.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java index 9610d7c1..90bae86e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java @@ -566,7 +566,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS mMenu.findItem(R.id.action_view_crosspost_parent_view_post_detail_activity).setVisible(mPost.getCrosspostParentId() != null); - if (mPost.getSelfText().equals("[deleted]")) { + if ("[deleted]".equals(mPost.getAuthor()) || "[deleted]".equals(mPost.getSelfText())) { mMenu.findItem(R.id.action_see_removed_view_post_detail_activity).setVisible(true); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/BottomSheetFragment/CommentMoreBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/BottomSheetFragment/CommentMoreBottomSheetFragment.java index bfdb0b0f..2fa1f3d7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/BottomSheetFragment/CommentMoreBottomSheetFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/BottomSheetFragment/CommentMoreBottomSheetFragment.java @@ -134,7 +134,7 @@ public class CommentMoreBottomSheetFragment extends RoundedBottomSheetDialogFrag dismiss(); }); - if (commentData.getCommentRawText().equals("[removed]")) { + if ("[removed]".equals(commentData.getCommentRawText())) { seeRemovedTextView.setVisibility(View.VISIBLE); seeRemovedTextView.setOnClickListener(view -> {