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 51de87f65b..33428b6e56 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 void clearImage(int index){ @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);