fix: check index exists.
All checks were successful
Check PR code / Lint (pull_request) Successful in 3m57s
Check PR code / build (pull_request) Successful in 13m44s

This commit is contained in:
Amine Bouabdallaoui 2025-02-16 13:57:42 +01:00
parent 0bb4fe6aed
commit 6a6d447456
2 changed files with 10 additions and 6 deletions

4
.gitignore vendored
View File

@ -323,4 +323,6 @@ fabric.properties
crowdin.properties crowdin.properties
.kotlin/ .kotlin/
build-cache/ build-cache/
act

View File

@ -161,12 +161,14 @@ class ReaderActivity :
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
super.onPageSelected(position) super.onPageSelected(position)
if (allItems[position].starred) { if (!allItems.isNullOrEmpty() && allItems.size >= position) {
canRemoveFromFavorite() if (allItems[position].starred) {
} else { canRemoveFromFavorite()
canFavorite() } else {
canFavorite()
}
readItem(allItems[position])
} }
readItem(allItems[position])
} }
}, },
) )