Fixes #9610
@@ -527,6 +527,8 @@ class LibraryScreenModel(
}
suspend fun getRandomLibraryItemForCurrentCategory(): LibraryItem? {
+ if (state.value.categories.isEmpty()) return null
+
return withIOContext {
state.value
.getLibraryItemsByCategoryId(state.value.categories[activeCategoryIndex].id)