mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 21:34:44 +02:00
Check for null URIs
This commit is contained in:
@@ -19,6 +19,9 @@ package eu.faircode.email;
|
||||
Copyright 2018-2021 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import static android.app.ActionBar.DISPLAY_SHOW_CUSTOM;
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
import android.app.RecoverableSecurityException;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -65,9 +68,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static android.app.ActionBar.DISPLAY_SHOW_CUSTOM;
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
public class FragmentBase extends Fragment {
|
||||
private String title = null;
|
||||
private String subtitle = " ";
|
||||
@@ -477,6 +477,9 @@ public class FragmentBase extends Fragment {
|
||||
long id = args.getLong("id");
|
||||
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));
|
||||
@@ -552,6 +555,9 @@ public class FragmentBase extends Fragment {
|
||||
long id = args.getLong("id");
|
||||
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