Skip to content

Commit f37bf2e

Browse files
authored
fix: prevent NPE in item selection logic (#430)
1 parent ee24460 commit f37bf2e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/src/main/kotlin/org/fossify/phone/adapters/RecentCallsAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class RecentCallsAdapter(
112112

113113
override fun getSelectableItemCount() = currentList.filterIsInstance<RecentCall>().size
114114

115-
override fun getIsItemSelectable(position: Int) = currentList[position] is RecentCall
115+
override fun getIsItemSelectable(position: Int) = currentList.getOrNull(position) is RecentCall
116116

117117
override fun getItemSelectionKey(position: Int) = currentList.getOrNull(position)?.getItemId()
118118

0 commit comments

Comments
 (0)