Skip to content

Commit

Permalink
Fix NullPointerException in ParsePost.parsePostsSync.
Browse files Browse the repository at this point in the history
  • Loading branch information
Docile-Alligator committed Nov 3, 2024
1 parent bb5d501 commit 8a96e4f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ public static LinkedHashSet<Post> parsePostsSync(String response, int nPosts, Po
}
}

Set<String> readPostsIds = readPostsList.getReadPostsIdsByIds(newPostsIds);
for (Post post: newPosts) {
if (readPostsIds.contains(post.getId())) {
post.markAsRead();
if (readPostsList != null) {
Set<String> readPostsIds = readPostsList.getReadPostsIdsByIds(newPostsIds);
for (Post post: newPosts) {
if (readPostsIds.contains(post.getId())) {
post.markAsRead();
}
}
}

Expand Down

0 comments on commit 8a96e4f

Please sign in to comment.