From e2ef16f46f4b75aa04d19a342e889142411fe490 Mon Sep 17 00:00:00 2001 From: "dswitkin@google.com" Date: Fri, 20 May 2011 15:40:21 +0000 Subject: [PATCH] Caught another exception when sharing contacts. git-svn-id: https://zxing.googlecode.com/svn/trunk@1789 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../google/zxing/client/android/share/ShareActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/src/com/google/zxing/client/android/share/ShareActivity.java b/android/src/com/google/zxing/client/android/share/ShareActivity.java index 4c9d0dfb5..45fdc34c1 100755 --- a/android/src/com/google/zxing/client/android/share/ShareActivity.java +++ b/android/src/com/google/zxing/client/android/share/ShareActivity.java @@ -196,7 +196,13 @@ public final class ShareActivity extends Activity { return; // Show error? } ContentResolver resolver = getContentResolver(); - Cursor contactCursor = resolver.query(contactUri, null, null, null, null); + Cursor contactCursor; + try { + // We're seeing about six reports a week of this exception although I don't understand why. + contactCursor = resolver.query(contactUri, null, null, null, null); + } catch (IllegalArgumentException e) { + return; + } Bundle bundle = new Bundle(); if (contactCursor != null && contactCursor.moveToFirst()) { int nameColumn = contactCursor.getColumnIndex(Contacts.PeopleColumns.NAME);