mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Check for null URIs
This commit is contained in:
@@ -19,6 +19,8 @@ package eu.faircode.email;
|
||||
Copyright 2018-2021 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_GMAIL;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Dialog;
|
||||
import android.app.NotificationChannel;
|
||||
@@ -107,8 +109,6 @@ import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.PBEKeySpec;
|
||||
|
||||
import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_GMAIL;
|
||||
|
||||
public class ActivitySetup extends ActivityBase implements FragmentManager.OnBackStackChangedListener {
|
||||
private View view;
|
||||
private DrawerLayout drawerLayout;
|
||||
@@ -571,6 +571,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
||||
Uri uri = args.getParcelable("uri");
|
||||
|
||||
if (uri == null)
|
||||
throw new FileNotFoundException();
|
||||
|
||||
String password = args.getString("password");
|
||||
EntityLog.log(context, "Exporting " + uri);
|
||||
|
||||
@@ -799,6 +803,9 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
" answers=" + import_answers +
|
||||
" settings=" + import_settings);
|
||||
|
||||
if (uri == null)
|
||||
throw new FileNotFoundException();
|
||||
|
||||
if (!"content".equals(uri.getScheme()) &&
|
||||
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE)) {
|
||||
Log.w("Import uri=" + uri);
|
||||
@@ -1403,6 +1410,9 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
Uri uri = args.getParcelable("uri");
|
||||
Log.i("Import certificate uri=" + uri);
|
||||
|
||||
if (uri == null)
|
||||
throw new FileNotFoundException();
|
||||
|
||||
boolean der = false;
|
||||
String extension = Helper.getExtension(uri.getLastPathSegment());
|
||||
Log.i("Extension=" + extension);
|
||||
|
||||
Reference in New Issue
Block a user