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

Commit 4181187f authored by Jay Shrauner's avatar Jay Shrauner Committed by Android Git Automerger
Browse files

am 02ecc3f4: Fix ContactLoader IllegalArgumentException crash

* commit '02ecc3f4':
  Fix ContactLoader IllegalArgumentException crash
parents 78088142 02ecc3f4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ public abstract class ContactBrowseListFragment extends

                Log.e(TAG, "Error: No contact ID or lookup key for contact " + mUri);
                return null;
            } catch (Exception e) {
                Log.e(TAG, "Error loading the contact: " + mUri, e);
                return null;
            } finally {
                if (cursor != null) {
                    cursor.close();
+7 −3
Original line number Diff line number Diff line
@@ -1915,9 +1915,13 @@ public class QuickContactActivity extends ContactsActivity {
                    return;
                }
                if (data.isError()) {
                    // This shouldn't ever happen, so throw an exception. The {@link ContactLoader}
                    // should log the actual exception.
                    throw new IllegalStateException("Failed to load contact", data.getException());
                    // This means either the contact is invalid or we had an
                    // internal error such as an acore crash.
                    Log.i(TAG, "Failed to load contact: " + ((ContactLoader)loader).getLookupUri());
                    Toast.makeText(QuickContactActivity.this, R.string.invalidContactMessage,
                            Toast.LENGTH_LONG).show();
                    finish();
                    return;
                }
                if (data.isNotFound()) {
                    Log.i(TAG, "No contact found: " + ((ContactLoader)loader).getLookupUri());