diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-12-27 19:58:18 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-12-27 19:58:18 +0100 |
commit | 0d23bade34f81a39d45bb4e18c453acb775055e6 (patch) | |
tree | 9a049160b4b26eb8c7b9632fa30616ef4e6ced77 /src | |
parent | 76b0b88d00cde44e2da9cbf6663b051e563637ec (diff) |
fix crash in MediaPreviewAdapter
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java | 6 |
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(); }); |