mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Add a fix when UserRecoverableAuthException.getIntent throws a null pointer exception
This commit is contained in:
+8
-1
@@ -98,7 +98,14 @@ public class CheckPermissionFragment extends Fragment {
|
||||
SendToGoogleUtils.getGoogleAccountCredential(getActivity(), accountName, scope);
|
||||
finish(scope, true, null);
|
||||
} catch (UserRecoverableAuthException e) {
|
||||
finish(scope, false, e.getIntent());
|
||||
Intent intent = null;
|
||||
try {
|
||||
// HACK: UserRecoverableAuthException.getIntent can throw a null pointer exception.
|
||||
intent = e.getIntent();
|
||||
} catch (Exception e1) {
|
||||
Log.e(TAG, "Exception in getIntent", e1);
|
||||
}
|
||||
finish(scope, false, intent);
|
||||
} catch (GoogleAuthException e) {
|
||||
Log.e(TAG, "GoogleAuthException", e);
|
||||
finish(scope, false, null);
|
||||
|
||||
Reference in New Issue
Block a user