mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-07 03:07:26 +01:00
Fix crash when parsing post with null readPostList value.
This commit is contained in:
parent
0d232fc4b8
commit
42957a1aa2
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user