diff options
author | Yorke Lee <yorkelee@google.com> | 2012-11-09 16:00:23 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-11-09 16:00:24 -0800 |
commit | 1d3e4209933247ee697421a94fb612198b4003ce (patch) | |
tree | 277c9738b3dea0fa39fba3714a614879e12e3fcd /src | |
parent | 6011abdc2e0a974a02bc5f21ccc6db3e971be11f (diff) | |
parent | 442756084d75d4ebd878e08617a5a4d578589734 (diff) |
Merge "Fix NPE if SmartDialLoaderTask has null context"
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/dialpad/SmartDialLoaderTask.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/dialer/dialpad/SmartDialLoaderTask.java b/src/com/android/dialer/dialpad/SmartDialLoaderTask.java index 74f2e5e05..832183785 100644 --- a/src/com/android/dialer/dialpad/SmartDialLoaderTask.java +++ b/src/com/android/dialer/dialpad/SmartDialLoaderTask.java @@ -168,14 +168,21 @@ public class SmartDialLoaderTask extends AsyncTask<String, Integer, List<SmartDi stopWatch.stopAndLog("SmartDial Already Cached", 0); return; } - + if (mContext == null) { + if (DEBUG) { + stopWatch.stopAndLog("Invalid context", 0); + } + return; + } final Cursor c = mContext.getContentResolver().query(ContactQuery.URI, (mNameDisplayOrder == ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY) ? ContactQuery.PROJECTION : ContactQuery.PROJECTION_ALTERNATIVE, ContactQuery.SELECTION, null, ContactQuery.ORDER_BY); if (c == null) { - stopWatch.stopAndLog("Query Failuregi", 0); + if (DEBUG) { + stopWatch.stopAndLog("Query Failure", 0); + } return; } sContactsCache = Lists.newArrayListWithCapacity(c.getCount()); |