diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt b/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt index ed2deec64..f6fdfad90 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryDao.kt @@ -39,7 +39,7 @@ abstract class HistoryDao { ListSortOrder.NEWEST -> "history.created_at DESC" ListSortOrder.PROGRESS -> "history.percent DESC" ListSortOrder.ALPHABETIC -> "manga.title" - ListSortOrder.NEW_CHAPTERS -> "(SELECT chapters_new FROM tracks WHERE tracks.manga_id = manga.manga_id) DESC" + ListSortOrder.NEW_CHAPTERS -> "IFNULL((SELECT chapters_new FROM tracks WHERE tracks.manga_id = manga.manga_id), 0) DESC" else -> throw IllegalArgumentException("Sort order $order is not supported") }