aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-12-07 13:52:51 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-12-07 13:52:51 +0000
commit42957a1aa2ebebd0a36043d21c2d66f585eb8706 (patch)
treed810a8dc1dfcf3f663ebc237ddc0d6e1c612aa53 /app/src/main
parent0d232fc4b86f259b6eeed6919a54017689be11b1 (diff)
downloadinfinity-for-reddit-42957a1aa2ebebd0a36043d21c2d66f585eb8706.tar
infinity-for-reddit-42957a1aa2ebebd0a36043d21c2d66f585eb8706.tar.gz
infinity-for-reddit-42957a1aa2ebebd0a36043d21c2d66f585eb8706.tar.bz2
infinity-for-reddit-42957a1aa2ebebd0a36043d21c2d66f585eb8706.tar.lz
infinity-for-reddit-42957a1aa2ebebd0a36043d21c2d66f585eb8706.tar.xz
infinity-for-reddit-42957a1aa2ebebd0a36043d21c2d66f585eb8706.tar.zst
infinity-for-reddit-42957a1aa2ebebd0a36043d21c2d66f585eb8706.zip
Fix crash when parsing post with null readPostList value.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java
index abf046af..e4a7303c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java
@@ -568,14 +568,17 @@ public class ParsePost {
size = nPosts;
}
- HashSet<ReadPost> readPostHashSet = new HashSet<>(readPostList);
+ HashSet<ReadPost> readPostHashSet = null;
+ if (readPostList != null) {
+ readPostHashSet = new HashSet<>(readPostList);
+ }
for (int i = 0; i < size; i++) {
try {
if (allData.getJSONObject(i).getString(JSONUtils.KIND_KEY).equals("t3")) {
JSONObject data = allData.getJSONObject(i).getJSONObject(JSONUtils.DATA_KEY);
Post post = parseBasicData(data);
boolean availablePost = true;
- if (readPostHashSet.contains(ReadPost.convertPost(post))) {
+ if (readPostHashSet != null && readPostHashSet.contains(ReadPost.convertPost(post))) {
post.markAsRead();
}
if (subredditFilterList != null) {