Improved share error handling

This commit is contained in:
M66B
2022-11-02 18:45:14 +01:00
parent 2a4b220b7b
commit 2b7b1c83b8
3 changed files with 13 additions and 9 deletions

View File

@@ -349,8 +349,12 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
}
private void onShare(EntityAttachment attachment) {
String title = (attachment.name == null ? attachment.cid : attachment.name);
Helper.share(context, attachment.getFile(context), attachment.getMimeType(), title);
try {
String title = (attachment.name == null ? attachment.cid : attachment.name);
Helper.share(context, attachment.getFile(context), attachment.getMimeType(), title);
} catch (Throwable ex) {
Log.unexpectedError(parentFragment.getParentFragmentManager(), ex);
}
}
private void onDownload(EntityAttachment attachment) {