diff options
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java | 7 |
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) { |