mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-30 21:07:11 +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;
|
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++) {
|
for (int i = 0; i < size; i++) {
|
||||||
try {
|
try {
|
||||||
if (allData.getJSONObject(i).getString(JSONUtils.KIND_KEY).equals("t3")) {
|
if (allData.getJSONObject(i).getString(JSONUtils.KIND_KEY).equals("t3")) {
|
||||||
JSONObject data = allData.getJSONObject(i).getJSONObject(JSONUtils.DATA_KEY);
|
JSONObject data = allData.getJSONObject(i).getJSONObject(JSONUtils.DATA_KEY);
|
||||||
Post post = parseBasicData(data);
|
Post post = parseBasicData(data);
|
||||||
boolean availablePost = true;
|
boolean availablePost = true;
|
||||||
if (readPostHashSet.contains(ReadPost.convertPost(post))) {
|
if (readPostHashSet != null && readPostHashSet.contains(ReadPost.convertPost(post))) {
|
||||||
post.markAsRead();
|
post.markAsRead();
|
||||||
}
|
}
|
||||||
if (subredditFilterList != null) {
|
if (subredditFilterList != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user