Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a699133 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Handle AccountManager failures so Shell doesn\'t crash. am: 213e355c

am: a70ae37b

* commit 'a70ae37b':
  Handle AccountManager failures so Shell doesn't crash.
parents 588ad4a5 a70ae37b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1102,7 +1102,14 @@ public class BugreportProgressService extends Service {
            preferredDomain = "@" + preferredDomain;
        }

        final Account[] accounts = am.getAccounts();
        final Account[] accounts;
        try {
            accounts = am.getAccounts();
        } catch (RuntimeException e) {
            Log.e(TAG, "Could not get accounts for preferred domain " + preferredDomain, e);
            return null;
        }
        if (DEBUG) Log.d(TAG, "Number of accounts: " + accounts.length);
        Account foundAccount = null;
        for (Account account : accounts) {
            if (Patterns.EMAIL_ADDRESS.matcher(account.name).matches()) {