mirror of
https://github.com/Docile-Alligator/Infinity-For-Reddit.git
synced 2026-02-14 19:25:49 +00:00
Ignore single comment parsing error.
This commit is contained in:
@ -19,8 +19,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.thing.MediaMetadata;
|
||||
import ml.docilealligator.infinityforreddit.commentfilter.CommentFilter;
|
||||
import ml.docilealligator.infinityforreddit.thing.MediaMetadata;
|
||||
import ml.docilealligator.infinityforreddit.utils.JSONUtils;
|
||||
import ml.docilealligator.infinityforreddit.utils.Utils;
|
||||
|
||||
@ -110,17 +110,22 @@ public class ParseComment {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Comment comment = parseSingleComment(childData, 0);
|
||||
String parentFullName = comment.getParentId();
|
||||
try {
|
||||
Comment comment = parseSingleComment(childData, 0);
|
||||
String parentFullName = comment.getParentId();
|
||||
|
||||
Comment parentComment = findCommentByFullName(newComments, parentFullName);
|
||||
if (parentComment != null) {
|
||||
parentComment.setHasReply(true);
|
||||
parentComment.addChild(comment, parentComment.getChildCount());
|
||||
parentComment.setChildCount(parentComment.getChildCount() + 1);
|
||||
} else {
|
||||
// assume that it is parent of this call
|
||||
newComments.add(comment);
|
||||
Comment parentComment = findCommentByFullName(newComments, parentFullName);
|
||||
if (parentComment != null) {
|
||||
parentComment.setHasReply(true);
|
||||
parentComment.addChild(comment, parentComment.getChildCount());
|
||||
parentComment.setChildCount(parentComment.getChildCount() + 1);
|
||||
} else {
|
||||
// assume that it is parent of this call
|
||||
newComments.add(comment);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
// Well we need to catch and ignore the exception to not show "error loading comments" to users
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user