mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 07:06:18 +02:00
Prevent crash
This commit is contained in:
@@ -4775,22 +4775,21 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
if (message.raw == null || !message.raw) {
|
||||
properties.setValue("raw_send", message.id, true);
|
||||
rawDownload(message);
|
||||
} else {
|
||||
File file = message.getRawFile(context);
|
||||
Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
|
||||
|
||||
Intent send = new Intent(Intent.ACTION_SEND);
|
||||
send.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
send.setType("message/rfc822");
|
||||
send.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
|
||||
} else
|
||||
try {
|
||||
File file = message.getRawFile(context);
|
||||
Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
|
||||
|
||||
Intent send = new Intent(Intent.ACTION_SEND);
|
||||
send.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
send.setType("message/rfc822");
|
||||
send.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
|
||||
context.startActivity(send);
|
||||
} catch (ActivityNotFoundException ex) {
|
||||
Log.w(ex);
|
||||
ToastEx.makeText(context, context.getString(R.string.title_no_viewer, send), Toast.LENGTH_LONG).show();
|
||||
} catch (Throwable ex) {
|
||||
// java.lang.IllegalArgumentException: Failed to resolve canonical path for ...
|
||||
Log.unexpectedError(parentFragment.getParentFragmentManager(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void rawDownload(TupleMessageEx message) {
|
||||
|
||||
Reference in New Issue
Block a user