Merge pull request 'fix: check index exists.' (#183) from fix-index into master
All checks were successful
Check master code / build (push) Successful in 8m3s

Reviewed-on: #183
This commit is contained in:
Amine Bouabdallaoui 2025-02-16 13:37:42 +00:00
commit 39f9505c00
2 changed files with 10 additions and 6 deletions

4
.gitignore vendored
View File

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

View File

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