mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Prevent crash
This commit is contained in:
parent
800feaeb68
commit
2c0e6d5ffe
1 changed files with 5 additions and 1 deletions
|
@ -19,6 +19,7 @@ package eu.faircode.email;
|
|||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -240,7 +241,10 @@ public class FragmentOAuth extends FragmentBase {
|
|||
if (BuildConfig.DEBUG)
|
||||
Log.i("OAuth uri=" + authRequest.toUri());
|
||||
Intent authIntent = authService.getAuthorizationRequestIntent(authRequest);
|
||||
startActivityForResult(authIntent, ActivitySetup.REQUEST_OAUTH);
|
||||
if (authIntent.resolveActivity(getContext().getPackageManager()) == null)
|
||||
throw new ActivityNotFoundException(authIntent.toString());
|
||||
else
|
||||
startActivityForResult(authIntent, ActivitySetup.REQUEST_OAUTH);
|
||||
} catch (Throwable ex) {
|
||||
showError(ex);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue