Fix IndexOutOfBoundsException in RemoteViewsFactory
This commit is contained in:
@@ -37,7 +37,7 @@ class RecentListFactory(
|
|||||||
|
|
||||||
override fun getLoadingView() = null
|
override fun getLoadingView() = null
|
||||||
|
|
||||||
override fun getItemId(position: Int) = dataSet[position].id
|
override fun getItemId(position: Int) = dataSet.getOrNull(position)?.id ?: 0L
|
||||||
|
|
||||||
override fun onDataSetChanged() {
|
override fun onDataSetChanged() {
|
||||||
val data = runBlocking { historyRepository.getList(0, 10) }
|
val data = runBlocking { historyRepository.getList(0, 10) }
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class ShelfListFactory(
|
|||||||
|
|
||||||
override fun getLoadingView() = null
|
override fun getLoadingView() = null
|
||||||
|
|
||||||
override fun getItemId(position: Int) = dataSet[position].id
|
override fun getItemId(position: Int) = dataSet.getOrNull(position)?.id ?: 0L
|
||||||
|
|
||||||
override fun onDataSetChanged() {
|
override fun onDataSetChanged() {
|
||||||
val data = runBlocking {
|
val data = runBlocking {
|
||||||
|
|||||||
Reference in New Issue
Block a user