aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-12-27 19:58:18 +0100
committerChristian Schneppe <christian@pix-art.de>2018-12-27 19:58:18 +0100
commit0d23bade34f81a39d45bb4e18c453acb775055e6 (patch)
tree9a049160b4b26eb8c7b9632fa30616ef4e6ced77 /src/main/java/de/pixart/messenger/ui
parent76b0b88d00cde44e2da9cbf6663b051e563637ec (diff)
fix crash in MediaPreviewAdapter
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java
index ae4c42816..64cb63439 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java
@@ -81,7 +81,11 @@ public class MediaPreviewAdapter extends RecyclerView.Adapter<MediaPreviewAdapte
}
holder.binding.deleteButton.setOnClickListener(v -> {
int pos = mediaPreviews.indexOf(attachment);
- mediaPreviews.remove(pos);
+ try {
+ mediaPreviews.remove(pos);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
notifyItemRemoved(pos);
conversationFragment.toggleInputMethod();
});