aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-09-23 12:18:07 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-09-23 12:18:07 +0000
commit3482ab36e9954be164e9ee4ae88ff188bb636100 (patch)
treef55d1ac57afb1785a6adffb69664cb953d7c3e5b /app/src
parent5f4ecbbe881fcfda3e7c4ec69efbbc7d546fedca (diff)
downloadinfinity-for-reddit-3482ab36e9954be164e9ee4ae88ff188bb636100.tar
infinity-for-reddit-3482ab36e9954be164e9ee4ae88ff188bb636100.tar.gz
infinity-for-reddit-3482ab36e9954be164e9ee4ae88ff188bb636100.tar.bz2
infinity-for-reddit-3482ab36e9954be164e9ee4ae88ff188bb636100.tar.lz
infinity-for-reddit-3482ab36e9954be164e9ee4ae88ff188bb636100.tar.xz
infinity-for-reddit-3482ab36e9954be164e9ee4ae88ff188bb636100.tar.zst
infinity-for-reddit-3482ab36e9954be164e9ee4ae88ff188bb636100.zip
Add null check in tryMarkingPostAsRead() in ViewPostDetailFragment.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
index 0fb79a49..e912418d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
@@ -1094,7 +1094,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
}
private void tryMarkingPostAsRead() {
- if (mMarkPostsAsRead && !mPost.isRead()) {
+ if (mMarkPostsAsRead && mPost != null && !mPost.isRead()) {
mPost.markAsRead(true);
InsertReadPost.insertReadPost(mRedditDataRoomDatabase, mExecutor, mAccountName, mPost.getId());
EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition));