From 3bf63e10905e0dea4089254f2dd65c170ad54241 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Fri, 8 Dec 2023 09:55:18 -0300 Subject: [PATCH] fix: a possible crash that might happen when the acestor descendant is null Wtf java, also cc @sk22 --- .../java/org/joinmastodon/android/fragments/ThreadFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java index 2576001e9f..d186059df0 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java @@ -320,7 +320,7 @@ public static List mapNeighborhoodAncestry(Status mainStat // ancestoring neighbor Optional.ofNullable(index > 0 ? ancestry.get(index - 1) : null) .filter(ancestor -> Optional.ofNullable(ancestor.descendantNeighbor) - .map(ancestorsDescendant -> ancestorsDescendant.id.equals(current.id)) + .map(ancestorsDescendant -> current.id.equals(ancestorsDescendant.id)) .orElse(false)) .map(a -> a.status) .orElse(null)