File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
6666import androidx.lifecycle.viewmodel.compose.viewModel
6767import androidx.paging.compose.LazyPagingItems
6868import androidx.paging.compose.collectAsLazyPagingItems
69+ import androidx.paging.compose.itemKey
6970import io.github.wiiznokes.gitnote.R
7071import io.github.wiiznokes.gitnote.data.room.Note
7172import io.github.wiiznokes.gitnote.ui.component.CustomDropDown
@@ -296,9 +297,9 @@ private fun GridNotesView(
296297
297298 items(
298299 count = gridNotes.itemCount,
299- key = { index -> gridNotes[index] !! .note.id }
300+ key = gridNotes.itemKey { it .note.id }
300301 ) { index ->
301- val gridNote = gridNotes[index]!!
302+ val gridNote = gridNotes[index] ? : return @items
302303
303304 NoteCard (
304305 gridNote = gridNote,
You can’t perform that action at this time.
0 commit comments