Skip to content

Commit 4a19081

Browse files
authored
Handle nullable inputs when removing last chip in the ChipInputAutoCompleteTextView (#5434)
**Story:** https://app.shortcut.com/simpledotorg/story/15703/handle-nullable-inputs-when-removing-last-chip-in-the-chipinputautocompletetextview
1 parent d9946bb commit 4a19081

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Handle window insets when displaying app content in edge-to-edge
88
- Enable edge-to-edge support on all versions of Android
9+
- Handle nullable inputs when removing last chip in the `ChipInputAutoCompleteTextView`
910

1011
## 2025.05.20
1112

app/src/main/java/org/simple/clinic/widgets/ChipInputAutoCompleteTextView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class ChipInputAutoCompleteTextView(
164164
}
165165

166166
private fun removeLastChip() {
167-
val lastInput = inputs.last()
167+
val lastInput = inputs.lastOrNull() ?: return
168168
val lastChip = rootView
169169
.children
170170
.filterIsInstance<Chip>()

0 commit comments

Comments
 (0)