From 44677c7af61b86105915f2f26e504e0a36e4248d Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 25 May 2022 14:29:49 +0200 Subject: [PATCH] Fix some crashes --- .../fedilab/android/helper/RecyclerViewThreadLines.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 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 c382d2f1..c931cd06 100644 --- a/app/src/main/java/app/fedilab/android/helper/RecyclerViewThreadLines.kt +++ b/app/src/main/java/app/fedilab/android/helper/RecyclerViewThreadLines.kt @@ -2,11 +2,7 @@ package app.fedilab.android.helper import android.content.Context import android.content.res.Resources -import android.graphics.Canvas -import android.graphics.Color -import android.graphics.DashPathEffect -import android.graphics.Paint -import android.graphics.Rect +import android.graphics.* import android.view.View import androidx.core.content.res.ResourcesCompat import androidx.preference.PreferenceManager @@ -68,8 +64,8 @@ class RecyclerViewThreadLines(context: Context, private val lineInfoList: List= nextLineInfo.fullLinesStart && level <= nextLineInfo.fullLinesEnd) { + if (i < lineInfoList.lastIndex - 1) { + val nextLineInfo = lineInfoList[i + 1] lineBottom = view.bottom.toFloat() } }