From f1c55aa5e836856fbf1f3d2f6962e32977e628ce Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sun, 17 Dec 2023 13:23:09 -0300 Subject: [PATCH] fix: crash that sometimes happens when longclicking emoji in compose I have no idea how it happens, nor why. But I am sure this will fix it --- .../org/joinmastodon/android/ui/CustomEmojiPopupKeyboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/CustomEmojiPopupKeyboard.java b/mastodon/src/main/java/org/joinmastodon/android/ui/CustomEmojiPopupKeyboard.java index 51de87f65..33428b6e5 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/CustomEmojiPopupKeyboard.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/CustomEmojiPopupKeyboard.java @@ -375,7 +375,7 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{ @Override public boolean onLongClick(){ - if(!isRecentEmojiCategory) return false; + if(!isRecentEmojiCategory || requests.size() < getAbsoluteAdapterPosition()-1 || 0 > getAbsoluteAdapterPosition()-1) return false; requests.remove(getAbsoluteAdapterPosition()-1); getBindingAdapter().notifyItemRemoved(getAbsoluteAdapterPosition()); getBindingAdapter().notifyItemChanged(0);