Commit c9445bb
authored
fix(ui-components): clamp UserReactionsView spanCount to avoid empty-list crash (#6476)
UserReactionsView.bindReactionList set GridLayoutManager.spanCount directly
from the size of the filtered reaction list. When the filter produces an
empty list (e.g. reactions whose user is null, or whose type has no
registered drawable in ChatUI.supportedReactions), spanCount = 0 was passed
to GridLayoutManager.setSpanCount, which rejects it with
IllegalArgumentException("Span count should be at least 1. Provided 0").
Coerce the value to at least 1. spanCount = 1 on an empty RecyclerView is
harmless; the modal opens with an empty grid instead of crashing.1 parent 3ae7d8f commit c9445bb
1 file changed
Lines changed: 3 additions & 1 deletion
File tree
- stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/reactions/user/internal
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
0 commit comments