修复特定情况下的NPE问题

This commit is contained in:
HapeLee
2025-09-09 13:21:10 +08:00
parent 66fefe1253
commit 85d425e847
@@ -81,7 +81,8 @@ class ChapterListAdapter(context: Context, val callback: Callback) :
val useReplace = AppConfig.tocUiUseReplace && book.getUseReplaceRule()
val items = getItems()
val indices = (startIndex until items.size) + (startIndex downTo 0)
val indices = ((startIndex until items.size) + (startIndex downTo 0))
.filter { it in items.indices }
for (i in indices) {
val item = items[i]