1
0
Fork 0

fixed a crash that probably happened due to the async suggestion rendering

This commit is contained in:
sspanak 2025-05-01 14:24:30 +03:00 committed by Dimo Karaivanov
parent 608e07a761
commit fe4c0bd949

View file

@ -295,7 +295,7 @@ public class SuggestionsBar {
* After that, you must call render(), to visualize the changes.
*/
private boolean appendHiddenSuggestionsIfNeeded(boolean scrollBack) {
if (mView == null || !visibleSuggestions.get(selectedIndex).equals(SHOW_MORE_SUGGESTION)) {
if (mView == null || selectedIndex < 0 || selectedIndex >= visibleSuggestions.size() || !visibleSuggestions.get(selectedIndex).equals(SHOW_MORE_SUGGESTION)) {
return false;
}