mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 06:38:29 +02:00
Check for null URIs
This commit is contained in:
@@ -172,13 +172,17 @@ public class ActivityEML extends ActivityBase {
|
||||
new SimpleTask<File>() {
|
||||
@Override
|
||||
protected File onExecute(Context context, Bundle args) throws Throwable {
|
||||
Uri uri = args.getParcelable("uri");
|
||||
|
||||
if (uri == null)
|
||||
throw new FileNotFoundException();
|
||||
|
||||
File dir = new File(getCacheDir(), "shared");
|
||||
if (!dir.exists())
|
||||
dir.mkdir();
|
||||
|
||||
File file = new File(dir, "email.eml");
|
||||
|
||||
Uri uri = args.getParcelable("uri");
|
||||
Helper.copy(context, uri, file);
|
||||
return file;
|
||||
}
|
||||
@@ -489,6 +493,9 @@ public class ActivityEML extends ActivityBase {
|
||||
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
||||
Uri uri = args.getParcelable("uri");
|
||||
|
||||
if (uri == null)
|
||||
throw new FileNotFoundException();
|
||||
|
||||
if (!"content".equals(uri.getScheme())) {
|
||||
Log.w("Save attachment uri=" + uri);
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
|
||||
|
||||
Reference in New Issue
Block a user