fix: possibly fixes a crash where inReplyToId is null in a ThreadFragment

cc: @sk22

Btw check the commit before this one, because there is a fix that applies for Megalodon there as well
This commit is contained in:
LucasGGamerM
2023-12-08 09:44:28 -03:00
parent 46115e8f3b
commit 3d48443a23

View File

@@ -315,7 +315,7 @@ public class ThreadFragment extends StatusListFragment implements ProvidesAssist
// descendant neighbor
Optional
.ofNullable(count > index + 1 ? statuses.get(index + 1) : null)
.filter(s -> s.inReplyToId.equals(current.id))
.filter(s -> current.id.equals(s.inReplyToId))
.orElse(null),
// ancestoring neighbor
Optional.ofNullable(index > 0 ? ancestry.get(index - 1) : null)