From 6c31f1f4a68fa52d7683de86569c17a067173469 Mon Sep 17 00:00:00 2001
From: 0xd9a <0xd9a@noreply.codeberg.org>
Date: Wed, 25 May 2022 19:06:31 +0530
Subject: [PATCH] Fix some crashes

---
 .../app/fedilab/android/helper/RecyclerViewThreadLines.kt   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/src/main/java/app/fedilab/android/helper/RecyclerViewThreadLines.kt b/app/src/main/java/app/fedilab/android/helper/RecyclerViewThreadLines.kt
index 1ad8ffd0..ca675b08 100644
--- a/app/src/main/java/app/fedilab/android/helper/RecyclerViewThreadLines.kt
+++ b/app/src/main/java/app/fedilab/android/helper/RecyclerViewThreadLines.kt
@@ -76,9 +76,9 @@ class RecyclerViewThreadLines(context: Context, private val lineInfoList: List<L
                     var lineBottom = view.bottom.toFloat() - view.height / 2
 
                     // if below status has a full line for current level, extend the line to the bottom
-                    if (i < childCount - 1) {
-                        if (i < lineInfoList.lastIndex - 1) {
-                            val nextLineInfo = lineInfoList[i + 1]
+                    if (i < lineInfoList.lastIndex - 1) {
+                        val nextLineInfo = lineInfoList[i + 1]
+                        if (level >= nextLineInfo.fullLinesStart && level <= nextLineInfo.fullLinesEnd) {
                             lineBottom = view.bottom.toFloat()
                         }
                     }