mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 02:41:52 +01:00
Avoid crash when trying to open random entry but categories are still loading
Fixes #9610
This commit is contained in:
parent
ee95c1439f
commit
0871208023
@ -527,6 +527,8 @@ class LibraryScreenModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getRandomLibraryItemForCurrentCategory(): LibraryItem? {
|
suspend fun getRandomLibraryItemForCurrentCategory(): LibraryItem? {
|
||||||
|
if (state.value.categories.isEmpty()) return null
|
||||||
|
|
||||||
return withIOContext {
|
return withIOContext {
|
||||||
state.value
|
state.value
|
||||||
.getLibraryItemsByCategoryId(state.value.categories[activeCategoryIndex].id)
|
.getLibraryItemsByCategoryId(state.value.categories[activeCategoryIndex].id)
|
||||||
|
Loading…
Reference in New Issue
Block a user